Repository navigation
chore: reduce sync-issues workflow frequency and simplify triggers - #95
Merged
Merged
Conversation
Change the sync issues workflow to run daily at 2:00 AM UTC and update the default target branch to 'dev'. Removed unnecessary branch determination logic for clarity. Refs: #91
5 tasks done
gerchowl
approved these changes
Feb 19, 2026
gerchowl
approved these changes
Feb 19, 2026
5 tasks done
c-vigo
added a commit
that referenced
this pull request
Jul 15, 2026
…1137) Closes #1136 ## What An OpenSSF Scorecard TokenPermissions audit (on `vig-os/commit-action`) traced every job-level `contents: write` / `actions: write` grant in the rendered release/sync workflow templates to the token that actually performs the write. Every git push, tag push, `gh release`, `gh pr`, `gh api` mutation and `gh workflow run` rides a **COMMIT_APP / RELEASE_APP installation token**, not the job's `GITHUB_TOKEN` — so those grants are vestigial. This reduces them to `read` at the source (`assets/workspace/.github/workflows/`), propagating to all consumers on upgrade. ## Reductions (write → read on `GITHUB_TOKEN`) | Template | Job | Grant | |---|---|---| | prepare-release.yml | prepare, rollback | contents | | promote-release.yml | validate, promote, merge, cleanup, floating-tags | contents | | release.yml | core caller | actions + contents | | release.yml | publish caller, rollback | contents | | release-core.yml | finalize | actions + contents | | release-publish.yml | publish | contents | | sync-issues.yml | sync | contents | | sync-main-to-dev.yml | sync | contents | Caller/callee pairs (`release.yml` `core`/`publish` ↔ `release-core.yml`/`release-publish.yml`) are lowered on both sides in the same change. ## Two grants handled with care 1. **`promote-release.yml` `validate`** — its *Verify draft GitHub Release exists* step listed releases with `GH_TOKEN: github.token` and matched a **draft**; GitHub only returns drafts to a push-capable token, so a bare read-only token would hide the draft and fail every promotion. The step now uses the RELEASE_APP token the job already mints, so the job can safely drop to `contents: read`. 2. **`sync-issues.yml` `sync` `actions: write`** — **kept**. Its *Delete old cache* step calls `gh api .../actions/caches/{id} -X DELETE` on `github.token`. Optional same-justification extras (`pull-requests`/`issues` write on App-token-driven jobs, not Scorecard-flagged) are deliberately left in place — out of scope here. ## Verification - TDD: flipped `tests/bats/just.bats` to pin the release caller/callee `GITHUB_TOKEN` blocks read-only (RED → GREEN). - `bats tests/bats/just.bats` — 46/46 pass. - `pytest` on `test_promote_mergeability`, `test_floating_tags`, `test_release_tag_prefix`, `test_workflow_prepare_extension` — 30/30 pass. - Full `just precommit` (incl. actionlint, yamllint, sync-manifest) green. - Downstream precedent: `vig-os/commit-action#94`/`#95` moved the repo-local smoke workflows to `permissions: {}` + job-level write with E2E and published-tag smokes passing. ## Pre-merge validation The `devcontainer-smoke-test` `repository_dispatch` flow already renders these templates into a real target and drives the full pipeline against them with real `RELEASE_APP`/`COMMIT_APP` tokens, so the App-token writes are genuinely exercised (a broken reduction fails the write and errors the wait step): - **prepare-release** → **release** → `release-core` `finalize` → **sync-issues** (finalize triggers it *and waits*, so a broken `sync-issues` permission fails the release the dispatch is waiting on) - **promote-release** → `merge` → push to `main` → **sync-main-to-dev** **Caveat:** promote-release is gated `if release_kind == 'final'`. An RC-only dispatch covers prepare + release + release-core + release-publish + sync-issues, but **not** promote-release or (transitively) sync-main-to-dev. To give the promote-release changes — including the load-bearing `validate` *Verify draft GitHub Release exists* `GH_TOKEN` fix — live coverage, validate with a **final** dispatch, not just a candidate. Refs: #1136
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.
Summary
0 0 * * *(midnight UTC) to0 2 * * *(2:00 AM UTC)issuesandpull_requestevents) — workflow now only runs on schedule or manual dispatchDetermine target branchstep; branch is now taken directly from theworkflow_dispatchinput (target-branch, defaulting todev)target-branchinput description to reflect supported values (dev,release/x.y.z)Closes #91
Test plan (only possible after merge)
workflow_dispatchwithout specifying a branch — confirm it checks outdevworkflow_dispatchwith a specific branch — confirm it checks out the specified branch