Skip to content

Cut Actions minutes: cancel superseded PR runs, skip OpenWiki on push - #42

Merged
krishagel merged 1 commit into
mainfrom
psd/ci-minutes
Nov 1, 2026
Merged

krishagel merged 1 commit into
mainfrom
psd/ci-minutes

Conversation

@krishagel

Copy link
Copy Markdown
Member

The org's $0 Actions budget stopped CI on Oct 31. Private and internal repos went $0.31 past the included minutes (38,799 min). These reusables run in every repo, so the savings below apply org-wide.

Cancel superseded PR runs (security-scan, dependency-review, psd-ci, secret-scan, license-check)

  • Each job's group is <job>-<repo>-<PR number || run id>, with cancel-in-progress only on pull_request.
  • A new push to a PR cancels the run still going for the old commit.
  • Default-branch pushes, scheduled runs and manual runs group by run id, so they never cancel or queue.
  • Job and check names are unchanged, so required checks still match.
  • reusable-claude-review.yml already does this and already skips Dependabot, so it's untouched.

OpenWiki: no rebuild on push

  • New optional input run_on_push (default false), plus job-level if: github.event_name != 'push' || inputs.run_on_push. A skipped job starts no runner and isn't billed.
  • All 95 callers also have the weekly schedule:, so every wiki still rebuilds weekly.
  • Behaviour change: wikis refresh weekly instead of after every merge. A repo that wants the old behaviour can opt in with run_on_push: true.

Release: v1.2.0 (new optional input; callers change nothing). After that, update the pins in workflow-templates/.

Checked: all workflows parse as YAML, and zizmor --offline on the four changed files reports no findings.

The org's $0 Actions budget stopped CI on 2026-10-31 after October's
private and internal usage went $0.31 past the included Enterprise
minutes (38,799 minutes, about $307 gross, billing API). Every repo calls
these reusables on every PR push and every merge, so small savings per
run add up across ~95-123 callers.

Concurrency on the per-PR jobs
- reusable-security-scan.yml: security-scan, dependency-review
- reusable-psd-ci.yml: psd-ci, secret-scan
- reusable-license-check.yml: license-check
Each job gets
  group: <job>-<repo>-<PR number || run id>
  cancel-in-progress: event_name == 'pull_request'
A new push to a PR cancels the still-running job for the old commit,
which could only report on a superseded head. Every other event
(push to the default branch, schedule, workflow_dispatch) groups by
run_id, so those runs never cancel or queue behind each other. The
job name is in the group so sibling jobs in the same reusable don't
cancel each other. Job and check names are unchanged, so required checks
keep matching. reusable-claude-review.yml already had this and already
skips Dependabot PRs, so it is untouched.

OpenWiki: no rebuild on push unless a caller opts in
- New optional input run_on_push (boolean, default false).
- The job has `if: github.event_name != 'push' || inputs.run_on_push`.
  A skipped job starts no runner and is not billed. The org template,
  and so every caller, also triggers on push. Done at job level here, one
  change covers all callers without a PR to each repo.
- All 95 repos with .github/workflows/openwiki-update.yml also have a
  `schedule:` trigger (checked with the contents API on 2026-11-01), so
  every wiki still rebuilds weekly. workflow_dispatch and the
  pull_request smoke test (openwiki-smoke.yml) are unaffected.
- Behaviour change for callers: wikis refresh weekly instead of after
  each merge. A repo that wants the old behaviour passes
  `run_on_push: true`.

Release as v1.2.0 (new optional input, callers need no file change).

Checked: every workflow parses as YAML, and `zizmor --offline` on the
four changed files reports no findings.
@krishagel
krishagel merged commit 85ef062 into main Nov 1, 2026
4 checks passed
@krishagel
krishagel deleted the psd/ci-minutes branch November 1, 2026 05:44
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.

1 participant