Repository navigation
ci: freeze PR links on merge - #111
Conversation
A pull request body or comment that links its own head branch breaks once the branch is deleted on merge. The new workflow calls the published michen00/freeze-pr-links action, which pins each such link to the head commit's SHA when the pull request merges. A dispatch with a pull request number freezes one that merged earlier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #111 +/- ##
=======================================
Coverage 57.79% 57.79%
=======================================
Files 33 33
Lines 2872 2872
=======================================
Hits 1660 1660
Misses 1212 1212
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a security-sensitive pull_request_target trigger with pull-requests: write permissions invoking a third-party action, which warrants final human sign-off despite following the no-checkout safe pattern.
No open issues 🎉
What changed in this PR
This PR adds a new GitHub Actions workflow, freeze-pr-links.yml, that rewrites a merged pull request's links pointing at its own head branch (.../blob/<branch>/<path>) into head-commit SHA permalinks, so they keep resolving after the branch is deleted on merge. It delegates the work to the published third-party action michen00/freeze-pr-links@v0.1.0 and documents the workflow in the CI instructions. It fits the repo's existing suite of PR-lifecycle automation workflows.
Changes:
- Add
pull_request_target(closed, basemain) +workflow_dispatchworkflow that runs the pinnedfreeze-pr-linksaction with minimalcontents: read/pull-requests: writepermissions and a no-checkout, safe pattern. - Support manual backfill via a
pr_numberdispatch input to repair PRs merged before the workflow existed. - Document the new workflow in
.github/instructions/CI.instructions.md.
| File | Description |
|---|---|
.github/workflows/freeze-pr-links.yml |
New workflow invoking michen00/freeze-pr-links@v0.1.0 on merge/dispatch with scoped permissions and concurrency gating. |
.github/instructions/CI.instructions.md |
Adds a documentation entry describing the new workflow's purpose and triggers. |
Review effort: Balanced
Summary
A pull request body or comment that links a file on its own head branch,
https://github.com/michen00/custom-commit-hooks/blob/<branch>/<path>, stops resolving once the branch is deleted on merge. Of the last 60 merged pull requests here, 17 have such a link in the body..github/workflows/freeze-pr-links.ymlcalls the published michen00/freeze-pr-links action atv0.1.0when a pull request merges intomain. The action rewrites each head-branch link in the body, the conversation comments, the review comments and the review summaries to point at the head commit's SHA. GitHub keeps that commit reachable throughrefs/pull/<n>/headafter the branch is gone. Aworkflow_dispatchwithpr_numberfreezes a pull request that merged before the workflow existed, which is how the 17 can be repaired after this merges.The workflow grants
contents: readandpull-requests: write, checks out nothing, and runs nothing from the pull request; the action's SECURITY.md states its own properties. Thev0.1.0tag is covered by a ruleset in that repository that blocks updating or deleting it, and the existing Dependabotgithub-actionsentry will propose later releases..github/instructions/CI.instructions.mdgains an entry for the workflow.Testing
make checkpasses: the pre-commit hooks, including actionlint and yamllint, every shell suite and 102 Python tests.A
pull_request_targetworkflow is read frommain, so this pull request cannot run it; its own merge is the first run.🤖 Generated with Claude Code