Skip to content

ci: Fix the publish loop guard and push before publishing - #517

Merged
howaskew merged 2 commits into
masterfrom
ci/fix-publish-workflow
Oct 19, 2026
Merged

howaskew merged 2 commits into
masterfrom
ci/fix-publish-workflow

Conversation

@howaskew

Copy link
Copy Markdown
Contributor

Summary

Makes the publish workflow safe to rerun, fixes its loop guard, and brings package.json back in line with npm.

Changes

Publish workflow (publish-to-npm.yaml)

  • Loop guard. The if: checked for hello@openactive.io, but the bot has committed as 207210293+openactive[bot] since May 2025, so a successful push of the version bump would start another publish. The job now skips runs started by openactive[bot], and the bump commit carries [skip ci], so the guard no longer depends on an email address.
  • Push before publishing. The version bump is pushed to master before npm publish. If the push is rejected, the job stops and nothing is published, so npm cannot get ahead of GitHub. The postpublish: git push script is removed, and publish-patch follows the same order.
  • Dispatch token. Without owner and repositories, create-github-app-token only covers the current repository, so dispatching to data-model-validator-site and openactive-test-suite could not work. The token is now requested for each target repository.
  • One publish runs at a time, permissions reduced to contents: read (pushes use the App token), and repository-dispatch updated to v3.

Version

  • package.json set to 3.0.4, which is already on npm but whose version bump never reached master. Without this, the next release would try to publish 3.0.4 again.

Verification

  • actionlint: no issues.
  • A simulated npm version patch -m "%s [skip ci]" produces the commit message 3.0.5 [skip ci], authored by openactive[bot].

When merged

Merging starts a publish: tests, bump to 3.0.5, push, publish, then dispatch to the validator site and the test suite. 3.0.5 contains the same validator code as 3.0.4. If the push to master is rejected, the run stops before publishing and nothing changes.

howaskew and others added 2 commits October 19, 2026 15:15
- Loop guard: skip runs started by openactive[bot] and add [skip ci] to
  the version bump commit. The previous guard checked for
  hello@openactive.io, but the bot has committed as
  207210293+openactive[bot] since May 2025, so every bump commit
  started another publish.
- Push the version bump before publishing, so a rejected push stops the
  run before anything reaches npm. Remove the postpublish git push.
- Scope the dispatch token to the target repository; without owner and
  repositories the App token only covers this repository.
- Keep publishing with the repo-level NPM_TOKEN2.
- Run one publish at a time, and update actions to current versions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3.0.4 is already published on npm, but the version bump commit never
reached GitHub because the push after publishing failed. Without this,
the next release would try to publish 3.0.4 again and npm would reject it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@howaskew
howaskew requested a review from hkir-dev October 19, 2026 15:08
@howaskew
howaskew marked this pull request as ready for review October 19, 2026 15:17
@howaskew
howaskew merged commit c06f57c into master Oct 19, 2026
12 checks passed
@howaskew
howaskew deleted the ci/fix-publish-workflow branch October 19, 2026 15:18
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