ci: scheduled Sync workflow-template pins job#100
Conversation
Keep the reusable-workflow SHA pins in workflow-templates/*.yml aligned with the latest release. Dependabot only scans .github/workflows, so it never bumps these, and the SHA-pin standard forbids a floating ref in the templates. This weekly job (also workflow_dispatch) rewrites the pins to the latest release SHA and opens a PR when they drift, going through the normal review + Security Suite gate via the Workflows App token.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughChangesWorkflow pin synchronization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant GeoloniaReleases
participant WorkflowTemplates
participant GitHubPullRequests
GitHubActions->>GeoloniaReleases: Resolve latest release tag and SHA
GitHubActions->>WorkflowTemplates: Rewrite matching SHA pins
GitHubActions->>GitHubPullRequests: Push branch and create or update PR
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🛡️ Security suite
Note All security checks passed. Updated for |
There was a problem hiding this comment.
Pull request overview
Adds an automated GitHub Actions workflow to keep workflow-templates/*.yml reusable-workflow SHA pins aligned with the latest geolonia/.github release, since Dependabot does not update templates outside .github/workflows.
Changes:
- Adds a weekly scheduled (and manually dispatchable) workflow to detect and rewrite pinned
geolonia/.githubreusable workflow refs inworkflow-templates/*.yml. - Opens or updates a PR with the rewritten pins using a GitHub App token so checks run on the sync PR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Request only contents: write + pull-requests: write when minting the Workflows App token, instead of inheriting the app's blanket installation permissions (zizmor dangerous-github-app-token, error severity).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
.github/workflows/sync-workflow-template-pins.yml:9
- The header comment claims the org SHA-pin standard forbids floating @v1/@main refs in workflow-templates, but workflow-templates/security-suite.yml intentionally uses @v1. Consider clarifying here that this job only rewrites SHA-pinned
...@<sha> # vX.Y.Zreferences, and leaves intentional@v1templates unchanged, to avoid misleading future maintainers.
# Why a dedicated job: Dependabot only scans .github/workflows, so it never
# bumps refs living under workflow-templates/. The org SHA-pin standard also
# forbids a floating @v1 / @main ref in those templates. So this periodic job
# rewrites the pins to the latest release and opens a PR when they drift; the
.github/workflows/sync-workflow-template-pins.yml:82
- Avoid embedding the App token directly in the
git pushcommand argument. This repo already uses a safer, consistent pattern of settingoriginonce (see .github/workflows/reusable-release-auto-on-tag.yml:152) and then pushing toorigin, which reduces the chance of the token being echoed in command output/error messages.
git push --force "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:${BRANCH}"
- Clarify the header comment: SHA-pinned reusable refs are rewritten; security-suite.yml deliberately floats on @v1 (ruleset-required) and is left untouched (the rewrite only matches SHA pins). - Add 'shopt -s nullglob' so an empty glob is a no-op, not a literal path. - Push via an authenticated origin with --force-with-lease (instead of --force to an inline URL) to avoid clobbering concurrent branch updates, matching the release workflow's pattern. (App-token least-privilege scoping was already added in an earlier commit.)
Why
The reusable-workflow SHA pins inside
workflow-templates/*.ymlare all stuck at v1.16.0 while the repo is at v1.35.0. Dependabot only scans.github/workflows, so it never bumps refs underworkflow-templates/, and the org SHA-pin standard forbids a floating@v1/@mainref there. So repos scaffolded/enrolled via the Backstage templates (which fetch these files) start from stale refs.What
Adds
.github/workflows/sync-workflow-template-pins.yml: weekly (+workflow_dispatch) job that rewrites everygeolonia/.github/.github/workflows/reusable-*.yml@<sha> # vX.Y.Zinworkflow-templates/*.ymlto the latest release SHA + tag, and opens a PR when they drift. Third-party action pins are untouched (left to Dependabot).persist-credentials: false, all actions SHA-pinned, vars passed via env (zizmor-clean).Needs verification before merge
pull_requests: write(it already hascontents: writefor tag pushes). If not,gh pr createwill fail and the app install needs that scope added.workflow_dispatchon a branch to confirm it produces the expected sync PR (should bump all templates v1.16.0 -> v1.35.0).Summary by CodeRabbit