Skip to content

feat: add Release Punter workflow#23694

Merged
pelikhan merged 4 commits intomainfrom
copilot/create-action-workflow-update-stable-release
Mar 31, 2026
Merged

feat: add Release Punter workflow#23694
pelikhan merged 4 commits intomainfrom
copilot/create-action-workflow-update-stable-release

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Summary

Adds a new standard GitHub Actions workflow (.github/workflows/update-stable-release.yml) named Release Punter to update the stable alias in .github/aw/releases.json.

Changes

.github/workflows/update-stable-release.yml (new file)

A workflow_dispatch-triggered workflow named "Release Punter" with the following behaviour:

Feature Detail
Input Optional version (e.g. v1.2.3). Omit to use the latest published release.
Fork guard Skips entirely when the workflow runs on a fork (!github.event.repository.fork)
Permission check Validates the triggering actor has admin or maintain role via GET /repos/{owner}/{repo}/collaborators/{actor}/permissionrole_name
Version resolution If no version is given, resolves to github.rest.repos.getLatestRelease
Release validation Verifies the version matches vMAJOR.MINOR.PATCH, exists as a published (non-draft) GitHub release, and warns if it is flagged as pre-release
Update Sets .aliases.stable in .github/aw/releases.json using jq
JSON validation Validates releases.json is still valid JSON after the jq update before committing
Idempotent Skips the commit/push if the stable alias is already at the requested version
Commit Committed as github-actions[bot] with message chore: update stable release to vX.Y.Z
Concurrency cancel-in-progress: false prevents two simultaneous runs from producing conflicting commits
Injection-safe All ${{ }} expression expansions are bound to env: variables and accessed via process.env.* (JS) or $VAR (shell)

The default path (no version input) moves stable to the latest release; providing an older version enables easy rollback.



✨ PR Review Safe Output Test - Run 23797519571

💥 [THE END] — Illustrated by Smoke Claude ·

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/34c8400f-ce29-4429-a454-b91614f2473f

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot name it "Release Punter"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/796051fd-b3b7-46dd-87bf-884bfff4414e

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot name it "Release Punter"

Done in 06fc209 — both the workflow name: and job name: are now "Release Punter".

Copilot AI changed the title feat: add update-stable-release workflow feat: add Release Punter workflow Mar 31, 2026
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot move inline variable expansions to env var references to avoid shell injection

…nt shell injection

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d184af5e-c5bf-4c67-841a-0b13f898be1e

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot move inline variable expansions to env var references to avoid shell injection

Done in 19a81d0. All three injection points are now safe:

  • inputs.versionenv: INPUT_VERSION read as process.env.INPUT_VERSION in JS
  • steps.version.outputs.version in the validate step → env: RELEASE_VERSION read as process.env.RELEASE_VERSION in JS
  • steps.version.outputs.version in both shell steps → env: VERSION referenced as $VERSION

@pelikhan pelikhan marked this pull request as ready for review March 31, 2026 12:37
Copilot AI review requested due to automatic review settings March 31, 2026 12:37
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit and push
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add a JSON validation of releases.json to ensure it wasn't broken

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ea29e78 — added a "Validate releases.json" step between the update and the commit. It runs jq empty on the file and fails the workflow if the JSON is invalid, preventing a corrupt file from being committed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a manually triggered GitHub Actions workflow (“Release Punter”) to update the stable alias in .github/aw/releases.json, with guardrails around who can run it and what release tags are allowed.

Changes:

  • Introduces a workflow_dispatch workflow that resolves a target version (explicit input or latest release).
  • Validates the triggering actor’s repo role and validates the target tag corresponds to a published (non-draft) release.
  • Updates .aliases.stable in .github/aw/releases.json and commits/pushes the change only when necessary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +104 to +106
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch can be run against any branch/ref in the UI. With the default actions/checkout behavior and a plain git push, this workflow will modify and push to whichever ref was selected when dispatching (including feature branches), rather than reliably updating the repository’s default branch.

Consider explicitly checking out github.event.repository.default_branch (or failing early when github.ref is not the default branch) and pushing to that branch to ensure stable is always updated in the intended place.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

update-stable:
name: Release Punter
runs-on: ubuntu-latest
# Never run on forks — they cannot push to the upstream repository
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fork guard is a good safety measure! Consider also adding a check that github.ref == refs/heads/main (or refs/heads/$\{\{ github.event.repository.default_branch }}) so this workflow only updates stable from the default branch, preventing accidental stable alias updates from feature branches dispatched in the UI.

});
version = release.tag_name;
core.info(`ℹ️ No version specified, resolved to latest: ${version}`);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-release warning via core.warning is good UX. Consider also surfacing this in the step summary (core.summary.addRaw(...)) so it's visible in the Actions UI without having to dig into logs — enterprise users monitoring releases will appreciate the extra visibility.

@pelikhan pelikhan merged commit 9c095ed into main Mar 31, 2026
@pelikhan pelikhan deleted the copilot/create-action-workflow-update-stable-release branch March 31, 2026 12:50
pull bot pushed a commit to Stars1233/gh-aw that referenced this pull request Mar 31, 2026
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.

3 participants