Skip to content

Update GitHub Action steps #1094

@tomschr

Description

@tomschr

Problem

This is just a friendly reminder that your GitHub workflow files uses some older versions.

$ git switch main
$ grep -r "uses: actions/" .github/workflows/
.github/workflows/docbook.yml:      - uses: actions/checkout@v4
.github/workflows/docbook.yml:      - uses: actions/checkout@v4
.github/workflows/docbook.yml:      - uses: actions/checkout@v4
.github/workflows/docbook.yml:        uses: actions/upload-artifact@v4
.github/workflows/docbook.yml:        uses: actions/download-artifact@v4

Although your workflows still work at the moment, it's not guaranteed this will be the same in the future. GitHub Actions also have bugs, security issues, or other problems. Newer GitHub Actions usually solves this.

It's a risk that your CI workflow breaks when old GitHub Actions aren't supported anymore. You can see already warnings in some of your jobs.

Branches

I guess, you want to integrate the changes also in all open branches, right?

How to fix that

I use the following method:

  1. Use the first action name without the @ and append it to the GitHub URL. For example, for actions/checkout@v4 you will end up with the URL https://github.com/actions/checkout.
  2. Append to this URL the suffix /tags. You end up with the URL https://github.com/actions/checkout/tags.
  3. Look at the list. The latest tag is at the top. In our example, it's v6.0.2. Although you could use that, normally you just us the major version. This is just v6.
  4. Go back to your workflow file and change @v4 by @v6.
  5. Do the same for the other GitHub Action steps and workflow files.
  6. Commit and push.

Pro tip

For the longer run, GitHub offers a Dependabot service. It searches for old/obsolete Actions and creates pull requests. This allows you to review them and decide if it's useful to integrate the PR. This is very helpful, as such things are easily forgotten. I use it in some of my projects.

For further information, see the Dependabot quickstart guide.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions