Skip to content

ci: run CI once per commit and start release only when VERSION changes - #5

Merged
macx merged 2 commits into
mainfrom
ci/avoid-duplicate-runs
Oct 23, 2026
Merged

macx merged 2 commits into
mainfrom
ci/avoid-duplicate-runs

Conversation

@macx

@macx macx commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What and why

Every merge to main started two workflows: ci (full run) and release (only the plan job, which then found "not a release commit"). A release commit even ran the full CI twice: once from ci.yml (push) and once inside release.yml (reusable ci.yml before releasing). Requested by the maintainer.

  • One rule for both workflows: new scripts/release-decision.sh decides whether a commit is released: official repository (macx/pickup), a push that changes VERSION against its parent, and the tag vX.Y.Z does not exist yet; or a manual run of release.yml.
  • release.yml: push to main has paths: [VERSION], and the plan job uses the shared rule. Every release commit from prepare-release bumps VERSION. workflow_dispatch (re-run after a failure) is unchanged.
  • ci.yml: a small route job (ubuntu) applies the same rule to its own push run; all eight jobs need it and are skipped only when release.yml will run CI for the commit. Inside the call from release.yml (github.workflow is release), and for pull requests, the schedule and manual runs, every job runs as before. Forks with CI enabled never match the rule, so their CI always runs.
  • Result: one CI run per commit; release only shows up for real releases. docs/RELEASING.md updated.

How it was tested

  • actionlint on all workflows, scripts/pin-actions.sh --check, shellcheck, scripts/security-checks.sh
  • scripts/release-decision.sh exercised in a throwaway worktree: normal push, fork, manual run with existing tag, release commit 0.1.0 → 0.2.0, same commit in a fork, pull_request event, VERSION changed but tag exists
  • Not exercisable before merging: the push and release paths only run on main. To check after merging: the next normal merge starts only ci; the next release commit starts release (with CI inside) and skips the jobs of the push run of ci.
  • Bluetooth changes: none

Checklist

  • No real phone numbers, names, Bluetooth addresses or secrets
  • No network access, no new third-party runtime dependency
  • Workflows changed at the maintainer's request

🤖 Generated with Claude Code

Every merge to main started two workflows: ci (full run) and release (plan job only). A release commit even ran the full CI twice, once from ci.yml and once inside release.yml. release.yml now starts only for pushes that change VERSION (every release commit does), and ci.yml skips its push run for "chore(release): vX.Y.Z" commits, whose CI runs inside release.yml (github.workflow is "release" there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release trigger and CI skip conditions disagree, leaving supported release commits without replacement CI or automatic publication.

1 open issue
What changed in this PR

This PR aims to avoid duplicate CI runs in Pickup’s release process and prevent release workflows from starting on ordinary pushes.

Changes:

  • Restricts automatic release runs to pushes that change VERSION.
  • Skips standalone push-CI jobs for release-prefixed commits, relying on reusable CI from the release workflow.
  • Documents the intended CI and release behavior.
File Description
docs/​RELEASING.md Documents CI deduplication and the release trigger.
.github/​workflows/​release.yml Adds the VERSION push-path filter.
.github/​workflows/​ci.yml Adds release-commit skip conditions to all eight jobs.

Review effort: Balanced

Comment thread .github/workflows/release.yml
Review: the release trigger (paths: VERSION) and the CI skip (commit subject) selected different commits, so a release commit without a VERSION change, a fork with CI enabled, or a VERSION change without the release prefix ended up with no CI or with two runs. scripts/release-decision.sh now decides for both: a push in macx/pickup that changes VERSION and whose tag does not exist yet (or a manual run of release.yml). A route job in ci.yml applies it to all eight jobs; release.yml's plan job uses it too. The same-version first release is history (v0.1.0 exists).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macx
macx merged commit cd9119c into main Oct 23, 2026
11 checks passed
@macx
macx deleted the ci/avoid-duplicate-runs branch October 23, 2026 11:30
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.

2 participants