Marco Eidinger
Swifty Tech by Marco Eidinger

Swifty Tech by Marco Eidinger

Why and how to adopt actions/checkout@v3 in your GitHub Action workflow

Why and how to adopt actions/checkout@v3 in your GitHub Action workflow

Marco Eidinger's photo
Marco Eidinger
Β·Oct 20, 2022Β·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Table of contents

  • Why
  • How

Nearly all GitHub Action workflows need to checkout a Git repository at a particular version.

If you still use actions/checkout@v2, it is time to update!

Why

Because the latest v2 version (= v2.5.0) still uses node12.

Node 12 has been out of support since April 2022, as a result we have started the deprecation process of Node 12 for GitHub Actions.

We plan to migrate all actions to run on Node16 by Summer 2023. We will monitor the progress of the migration and listen to the community for how things are going before we define a final date.

To raise awareness of the upcoming change, we are adding a warning into workflows which contain Actions running on Node 12. This will come into effect starting on September 27th.

Source: GitHub Actions: All Actions will begin running on Node16 instead of Node12

How

You might have several GitHub repositories and each of them can contain multiple workflow files.

You can easily replace actions/checkout@v2 with actions/checkout@v3 in all your local yml files, within a folder hierarchy, with the following command:

find . -type f -name "*.yml" -print0 | xargs -0 sed -i '' -e 's/actions\/checkout@v2/actions\/checkout@v3/g'
Β 
Share this