Update GitHub Actions Versions
ActionsAbout
Tags
(1)A GitHub Action that automatically updates GitHub Actions to their latest versions in your workflow files and creates a pull request with detailed change information.
I created this action to help teams keep their GitHub Actions dependencies up-to-date automatically. Everyone is welcome to use it freely in their projects. If you encounter any issues or bugs, feel free to open an issue and we can solve it together!
- 🔄 Automatic version detection and updates for all GitHub Actions
- 📊 Detailed PR with version change table
- 🎯 Smart detection - only creates PR when updates are available
- 🏷️ Customizable PR labels and branch naming
- 📝 Professional PR template with review checklist
- ⏭️ Skips commit SHA-based actions automatically
- 🚀 Zero configuration required - works out of the box
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: 525Kiran/525Kiran-actions-version-update@v1
with:
github-token: ${{ secrets.PAT_TOKEN }}Note: A Personal Access Token (PAT) with workflow scope is required. See Setup Guide below.
name: Update GitHub Actions Versions
on:
schedule:
# Run every Monday at 9:00 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch: # Allow manual trigger
jobs:
update-actions:
name: Update GitHub Actions
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }} # Required: PAT with 'workflow' scope
- name: Update GitHub Actions versions
uses: 525Kiran/525Kiran-actions-version-update@v1
with:
github-token: ${{ secrets.PAT_TOKEN }} # Required: PAT with 'workflow' scope- uses: 525Kiran/525Kiran-actions-version-update@v1
with:
github-token: ${{ secrets.PAT_TOKEN }}
git-user-name: 'dependency-bot'
git-user-email: 'bot@example.com'
pr-title: 'chore: update github actions to latest versions'
pr-labels: 'dependencies,automated,github-actions'
branch-prefix: 'deps/update-actions'| Input | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token with workflow scope (use PAT) |
Yes | ${{ github.token }} |
git-user-name |
Git user name for commits | No | github-actions[bot] |
git-user-email |
Git user email for commits | No | github-actions[bot]@users.noreply.github.com |
pr-title |
Title for the pull request | No | chore: update github actions versions |
pr-body |
Body content for the pull request | No | Professional template with table |
pr-labels |
Comma-separated labels to add to PR | No | automated-pr,dependencies |
branch-prefix |
Prefix for the branch name | No | chore/update-github-actions |
| Output | Description |
|---|---|
updates-made |
Whether any updates were made (true/false) |
pr-number |
Pull request number if created |
pr-url |
Pull request URL if created |
Important: This action requires a Personal Access Token (PAT) with workflow scope because the default GITHUB_TOKEN cannot modify workflow files.
-
Create a Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a name like "Actions Version Update"
- Select scopes:
repoandworkflow - Click "Generate token" and copy it
-
Add PAT to Repository Secrets
- Go to your repository → Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
PAT_TOKEN - Value: Paste your PAT
- Click "Add secret"
-
Create Workflow File
- Create
.github/workflows/update-actions.ymlin your repository - Copy the complete workflow example above
- Commit and push the workflow file
- Create
-
Run the Action
- The action will run on schedule or can be triggered manually via workflow_dispatch
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9 AM UTC
# or
- cron: '0 0 1 * *' # First day of every monthThe workflow needs these permissions to create PRs:
permissions:
contents: write # To push branch
pull-requests: write # To create PR- Scans all workflow files in
.github/workflows/ - Extracts GitHub Actions and their current versions
- Queries GitHub API for latest versions
- Updates version references in workflow files
- Creates a new branch with timestamp
- Commits changes and pushes branch
- Creates a pull request with detailed version change table
- Adds specified labels to the PR
The action creates a professional PR with:
## 🔄 Automated GitHub Actions Version Update
This pull request updates GitHub Actions dependencies to their latest available versions.
### 📊 Updated Actions
| Action | Previous Version | Updated Version |
|--------|------------------|-----------------|
| actions/checkout | v3 | v4.2.0 |
| actions/setup-node | v3.8.1 | v4.0.1 |
| peter-evans/create-pull-request | v5.0.2 | v6.1.0 |
### 🔍 Review Checklist
- [ ] Review the version changes and release notes for breaking changes
- [ ] Verify all workflows execute successfully with updated versions
- [ ] Confirm no deprecated features are being used
- [ ] Check for any new required inputs or configuration changesThis is the most common error. The default GITHUB_TOKEN cannot modify workflow files.
Solution: Use a Personal Access Token (PAT) with workflow scope:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- uses: 525Kiran/525Kiran-actions-version-update@v1
with:
github-token: ${{ secrets.PAT_TOKEN }}- Verify all actions are not already up-to-date
- Check workflow has required permissions
- Ensure PAT has
repoandworkflowscopes - Verify Actions are enabled in repository settings
- PAT tokens have higher rate limits than
GITHUB_TOKEN - If you hit rate limits, consider running less frequently
- Ensure you're using a PAT with
workflowscope (notGITHUB_TOKEN) - Add workflow permissions:
permissions: contents: write pull-requests: write
- Verify PAT has
repoandworkflowscopes enabled
- Ensure workflow files are in
.github/workflows/directory - Check files have
.ymlor.yamlextension - Verify actions use version tags (not commit SHAs)
- The action uses timestamps in branch names to avoid conflicts
- If error persists, manually delete old branches or change
branch-prefix
You can customize the PR body with placeholders:
- uses: 525Kiran/525Kiran-actions-version-update@v1
with:
pr-body: |
## Custom Update Report
{UPDATES_TABLE}
Generated at: {TIMESTAMP}
Please review carefully!Available placeholders:
{UPDATES_TABLE}- Replaced with version change table{TIMESTAMP}- Replaced with current UTC timestamp
Combine with auto-merge for fully automated updates:
- name: Enable auto-merge
if: steps.update.outputs.pr-number != ''
run: gh pr merge ${{ steps.update.outputs.pr-number }} --auto --squash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}Send notifications when updates are available:
- name: Notify on updates
if: steps.update.outputs.updates-made == 'true'
uses: actions/github-script@v7
with:
script: |
console.log('PR created: ${{ steps.update.outputs.pr-url }}')
// Add your notification logic hereContributions, issues, and feature requests are welcome! Feel free to check the issues page.
If you find this action helpful, give it a ⭐️ on GitHub!
This project is open source and available for everyone to use freely.
Update GitHub Actions Versions is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.