Skip to content

Add workflow to auto-update action hash references on push to main#14

Merged
markgaze merged 3 commits intomainfrom
copilot/update-hash-values-in-workflows
Apr 22, 2026
Merged

Add workflow to auto-update action hash references on push to main#14
markgaze merged 3 commits intomainfrom
copilot/update-hash-values-in-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

When bump/action.yml or format/action.yml changes on main, the pinned commit SHA referenced in the corresponding reusable workflow (bump.yml / format.yml) needs to be manually updated — this automates that.

Changes

  • New workflow .github/workflows/update-action-hashes.yml
    • Triggers on push to main scoped to bump/action.yml and format/action.yml
    • Diffs HEAD~1..HEAD to detect which action file changed, then patches only the corresponding workflow file
    • Replaces markgaze/automation/{bump,format}@<40-char-hex> with the triggering commit SHA via sed
    • Opens (or updates) a PR on a fixed branch update-action-hashes via peter-evans/create-pull-request

Example

After a push to main that modifies bump/action.yml, the workflow rewrites:

# before
uses: markgaze/automation/bump@f794b216cfcebf29cbf84ede8bf533aa6aebbeba # main

# after (new commit SHA)
uses: markgaze/automation/bump@<new-sha> # main

Copilot AI and others added 2 commits April 22, 2026 15:00
@markgaze markgaze marked this pull request as ready for review April 22, 2026 15:04
@markgaze markgaze merged commit 9908b2f into main Apr 22, 2026
2 checks passed
@markgaze markgaze deleted the copilot/update-hash-values-in-workflows branch April 22, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants