Skip to content

chore: reduce sync-issues workflow frequency and simplify triggers - #95

Merged
c-vigo merged 1 commit into
mainfrom
chore/91-reduce-sync-issues-frequency
Feb 19, 2026
Merged

c-vigo merged 1 commit into
mainfrom
chore/91-reduce-sync-issues-frequency

Conversation

@c-vigo

@c-vigo c-vigo commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Changes cron schedule from 0 0 * * * (midnight UTC) to 0 2 * * * (2:00 AM UTC)
  • Removes event-based triggers (issues and pull_request events) — workflow now only runs on schedule or manual dispatch
  • Removes the dynamic Determine target branch step; branch is now taken directly from the workflow_dispatch input (target-branch, defaulting to dev)
  • Simplifies target-branch input description to reflect supported values (dev, release/x.y.z)

Closes #91

Test plan (only possible after merge)

  • Verify workflow runs correctly on the daily schedule at 2:00 AM UTC
  • Trigger manually via workflow_dispatch without specifying a branch — confirm it checks out dev
  • Trigger manually via workflow_dispatch with a specific branch — confirm it checks out the specified branch

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
@c-vigo
c-vigo changed the base branch from dev to main February 19, 2026 15:40
@c-vigo c-vigo self-assigned this Feb 19, 2026
@c-vigo c-vigo linked an issue Feb 19, 2026 that may be closed by this pull request
5 tasks done
@c-vigo
c-vigo requested a review from gerchowl February 19, 2026 15:40
@c-vigo
c-vigo merged commit ca04f8f into main Feb 19, 2026
@c-vigo
c-vigo deleted the chore/91-reduce-sync-issues-frequency branch February 19, 2026 17:04
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce sync-issues workflow frequency to daily schedule only

2 participants