Automatically update GitHub Action versions

Automatically update GitHub Action versions

BackerLeader ●20 ●169 ●274
calendar_today • schedule1 min read
— Originally published at stevefenton.co.uk

You don't notice your GitHub Actions versions until you start getting warnings about things like "Node 20 is no longer supported". When you think about it, GitHub Actions are yet another dependency that needs to be kept up to date and present supply chain risks.

Get Dependabot to do the work

The good news is, you can get Dependabot to keep your GitHub Actions up to date for you. You can add instructions for this to your .github/dependabot.yml:

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"

In my case I already had configuration for my npm dependencies:

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

But it's trivial to add multiple updates to the same file:

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"

Automatic pull requests

When you first commit this file, you'll notice pull requests start appearing for your review.

Dependabot pull request to update a GitHub Action version

- name: Setup pnpm cache
    uses: actions/cache@v4 (-)
    uses: actions/cache@v5 (+)

This is a simple example of how you can use Dependabot to keep your GitHub Actions up to date. You can find more information about Dependabot in the GitHub documentation.

Want more #github & #github-actions deep dives?

Join 6,110+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

2 Comments

1 vote
1

More Posts

Running OpenAPI Validation in GitHub Actions and Showing Findings in Pull Requests

Ganesh Kumar - Jul 3

Setting GitHub as a trusted publisher for npm

Steve Fentonverified - May 26

GitHub workflows tips and tricks

Nicolas Fränkel - Aug 28, 2025

Unlocking AI-Native Development: Key Highlights from GitHub Galaxy 2025

Sunny - Aug 10, 2025

Why Dependencies Are Your Biggest Security Risk

Lucky - Jul 27
chevron_left
17.6k Points • 463 Badges
117Posts
181Comments
142Connections
Steve Fenton is an Octonaut at Octopus Deploy. He’s a Software Punk, author, programming-architect, ... Show more

Related Jobs

Commenters (This Week)

3 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!