Repository navigation
ci: test release scripts and lint workflows - #581
Merged
Merged
Conversation
jrusso1020
approved these changes
Nov 16, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approving. Every job keeps the permissions it uses after write access moved off the workflow level, and the new tests catch removed guards.
Permissions, job by job (parsed from the YAML at head)
release-stable.ymlanddev-release.ymlnow have top-levelpermissions: {}. Every job declares its own permissions, so none of them inherits the empty set by accident.release:contents: write. It pushes the tag, and GoReleaser creates the draft release. Listing releases to find this run's draft also needs write, because drafts are only visible with push access.cleanup-failed-release:contents: write. It runsgit push --force-with-lease ... :refs/tags/<tag>andDELETE releases/<id>. Its checkout keeps credentials for that push, so theartipackedignore is justified there and onrelease.publish-release:contents: writefor thePATCH draft=false.publish-cdn(stable only):contents: read+id-token: write. It runs afterpublish-release, so the release it downloads is already public and read is enough. The checkout is nowpersist-credentials: false, and the job only runsgit ls-remote.
ci.yml: top-levelcontents: read.pr-templateaddspull-requests: read,surface-reportkeeps itspull-requests: write, and every checkout drops persisted credentials.
Tests. run.sh passes locally (25/25). I removed six guards one at a time, and a test failed for each:
- the draft check in
download-release-assets.sh - the checksums-hash comparison in
download-release-assets.sh - the tag-message/run-id match in
cleanup-failed-release.sh - the non-draft refusal in
cleanup-failed-release.sh - the numeric run-id validation in
cleanup-failed-release.sh - an exit in
check-cdn-publish.sh
The fake fails any call a test didn't register, which keeps the call assertions honest.
Tool pins. ACTIONLINT_SHA256 matches actionlint_1.7.12_checksums.txt. ZIZMOR_SHA256 matches the v1.32.0 asset digest. workflow-lint is green at head, so the # v7.0.1 # zizmor: ignore[artipacked] double comment parses.
Non-blocking:
fake-command.shkeys calls on"$tool ${args[*]}", so argument boundaries are lost (gh api "a b"andgh api a bshare a key). None of the current scripts pass arguments with spaces. Joining withprintf '%q 'would make the key exact if that ever changes.- The red
govulncheckis main's Go toolchain advisory (fixed by the Go bump PR), not this change.
— Rames
Co-Authored-By: Claude Opus 5.5 <[email protected]>
somanshreddy
force-pushed
the
11-16-ci_test_and_lint_release_scripts
branch
from
November 16, 2026 02:57
0c4155c to
51b3e1a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Surfaces: CI | Module: Release
Summary
Adds automated tests for the release helper scripts, and lints every workflow in CI with actionlint, shellcheck and zizmor. It also narrows workflow token permissions and stops keeping checkout credentials where a job doesn't use them. A release does exactly what it did before.
How it works
gh,awsandgitcommands first on PATH and runs each real release script. Each test checks the exit code, the key output line and the exact calls the script made. A call the test didn't register fails the test.release-scriptsruns the tests and shellcheck.workflow-lintruns actionlint and zizmor. Both tools are installed as pinned releases with a checked sha256, the way GoReleaser already is.contents: readby default, and the release workflows grantcontents: writeonly to the release job.persist-credentials: false. The checkouts that push or delete the release tag keep their credentials, with an inline zizmor ignore that gives the reason.Testing
make test-release-scripts: all 25 tests pass. Each check was confirmed to fail when the line it covers is broken: 38 single-line mutations, all caught.run:block.🤖 Generated with Claude Code