Repository navigation
ci(scratch): one-off actions.lock regeneration for main (not for merge) #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # ONE-OFF, scratch branch only, deleted after use. Regenerates main's | ||
| # actions.lock with the estate repair order (regen_lock in | ||
| # standards/scripts/regen-dependabot-locks.sh), runs the governance gate's own | ||
| # check against the result, and prints the lock base64-encoded. It has no | ||
| # `uses:` steps, so it needs no lock entry to start. It writes nothing back: | ||
| # the lock reaches the repository in a reviewed PR. | ||
| name: one-off actions.lock regeneration | ||
| on: | ||
| push: | ||
| branches: [claude/new-session-th4e9w-lockregen] | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| regen: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPO: ${{ github.repository }} | ||
| STANDARDS_REGEN_SHA: ae36881b5ff4b469fb904b66542ac226a15107f3 | ||
| STANDARDS_GATE_SHA: 8f2ee50841e216cd8c192eeb68953118190f105c | ||
| steps: | ||
| - name: Regenerate main's actions.lock and check it with the gate | ||
| run: | | ||
| set -uo pipefail | ||
| git clone --quiet --branch main "https://github.com/$REPO.git" pb | ||
| git -C pb log --oneline -1 | ||
| git clone --quiet https://github.com/hyperpolymath/standards.git std | ||
| git -C std worktree add --quiet --detach ../std-regen "$STANDARDS_REGEN_SHA" | ||
| git -C std worktree add --quiet --detach ../std-gate "$STANDARDS_GATE_SHA" | ||
| sudo apt-get install -y -qq gawk >/dev/null | ||
| gh extension install github/gh-actions-lock --pin v0.2.0 | ||
| gh actions-lock --version | ||
| export GH_BIN=gh REGEN_TOOLS="$PWD/std-regen/scripts" | ||
| source std-regen/scripts/regen-dependabot-locks.sh | ||
| outcome="$(regen_lock "$PWD/pb")" | ||
| echo "OUTCOME=$outcome" | ||
| git -C pb status --porcelain | ||
| echo "== the governance gate, as pinned by proof-burrower ($STANDARDS_GATE_SHA)" | ||
| (cd pb && ACTIONS_LOCK_VERIFIER="$PWD/../std-gate/scripts/update-actions-lock.sh" \ | ||
| bash ../std-gate/scripts/check-actions-lock-gate.sh .github/workflows); echo "GATE_RC=$?" | ||
| echo "LOCK-SHA256 $(sha256sum < pb/.github/workflows/actions.lock | cut -d' ' -f1)" | ||
| echo "LOCK-BEGIN" | ||
| base64 -w0 pb/.github/workflows/actions.lock; echo | ||
| echo "LOCK-END" | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/proof-burrower
Length of output: 1888
🏁 Script executed:
Repository: hyperpolymath/proof-burrower
Length of output: 4214
🏁 Script executed:
Repository: hyperpolymath/proof-burrower
Length of output: 17539
🌐 Web query:
GitHub Actions official documentation default shell run step Linux bash -e pipefail💡 Result:
Fail the workflow when
regen_lockreports a failed outcome.regen_lockreturns status 0 for failure outcomes such astool-failed,unresolvable,corrupt,dirty, andunverified. The workflow only printsoutcome, so it can report a successful step and emit the unchanged lock. Treat onlycurrentandchangedas successful outcomes.The gate failure is not masked by
echo "GATE_RC=$?": GitHub Actions already enableserrexitfor the default Bash shell. Capture the gate status explicitly so the status is printed before the workflow exits.🐛 Suggested fix
outcome="$(regen_lock "$PWD/pb")" echo "OUTCOME=$outcome" + case "$outcome" in + current|changed) regen_rc=0 ;; + *) regen_rc=1 ;; + esac git -C pb status --porcelain echo "== the governance gate, as pinned by proof-burrower ($STANDARDS_GATE_SHA)" - (cd pb && ACTIONS_LOCK_VERIFIER="$PWD/../std-gate/scripts/update-actions-lock.sh" \ - bash ../std-gate/scripts/check-actions-lock-gate.sh .github/workflows); echo "GATE_RC=$?" + if (cd pb && ACTIONS_LOCK_VERIFIER="$PWD/../std-gate/scripts/update-actions-lock.sh" \ + bash ../std-gate/scripts/check-actions-lock-gate.sh .github/workflows); then + gate_rc=0 + else + gate_rc=$? + fi + echo "GATE_RC=$gate_rc" echo "LOCK-SHA256 $(sha256sum < pb/.github/workflows/actions.lock | cut -d' ' -f1)" echo "LOCK-BEGIN" base64 -w0 pb/.github/workflows/actions.lock; echo echo "LOCK-END" + if [ "$regen_rc" -ne 0 ] || [ "$gate_rc" -ne 0 ]; then + exit 1 + fi🤖 Prompt for AI Agents