Skip to content

ci(release): fix unsigned commits by creating version commits via GitHub API#73

Merged
JamesLawton merged 1 commit intomainfrom
feat/signed-release-commits
Apr 14, 2026
Merged

ci(release): fix unsigned commits by creating version commits via GitHub API#73
JamesLawton merged 1 commit intomainfrom
feat/signed-release-commits

Conversation

@MaximusHaximus
Copy link
Copy Markdown
Contributor

@MaximusHaximus MaximusHaximus commented Apr 14, 2026

Fixes https://github.com/0xPolygon/polygon-agent-cli/actions/runs/24392931926/job/71243420384 — GH013, unsigned commit rejected by main's signed-commits rule.

POST /repos/.../git/commits (REST) creates raw git objects and does not sign them. The GraphQL createCommitOnBranch mutation is the only GitHub API that produces a verified commit. The script runs lerna version --no-push, captures the resulting file changes, then replays them via createCommitOnBranch to create a signed commit that atomically advances the branch. No git push involved.

Verified locally: createCommitOnBranch returned verified=true, reason=valid against the real repo before pushing to CI.

npm publish is split into npm-publish.yml, triggered by @polygonlabs/** tag pushes, so a failed publish can be retried in the Actions UI without re-versioning.

…Hub API

Fixes https://github.com/0xPolygon/polygon-agent-cli/actions/runs/24392931926/job/71243420384

The release workflow was failing with GH013: lerna's local git commit
was unsigned and rejected by main's "require signed commits" rule.

Instead of pushing lerna's commit, .github/scripts/lerna-signed-release.sh
runs lerna version --no-push, captures the resulting tree/parent/message,
then re-creates the commit via POST /repos/.../git/commits. GitHub signs
API-created commits with its web-flow GPG key, satisfying the rule.
The branch ref and version tags are then advanced entirely through the
GitHub API — no git push involved.

npm publish is split into a separate tag-triggered workflow
(npm-publish.yml) so a failed publish can be retried in the GitHub
Actions UI without any risk of double-versioning.

Changes:
- .github/scripts/lerna-signed-release.sh (new): runs lerna version
  --no-push, creates a signed commit and version tags via the GitHub
  API, creates GitHub releases. Each remote step is idempotent (checks
  before creating). Supports --dry-run for local verification.
- .github/workflows/release.yml: simplified to call the script.
- .github/workflows/npm-publish.yml (new): triggered by
  @polygonlabs/** tag pushes; runs lerna publish from-package with
  OIDC trusted-publisher auth, matching the existing setup.
- lerna.json: removed createRelease — lerna would fail trying to
  create releases before tags exist on GitHub when run with --no-push.
  The script now owns that step explicitly.
@MaximusHaximus MaximusHaximus marked this pull request as ready for review April 14, 2026 12:11
@JamesLawton JamesLawton merged commit 028b205 into main Apr 14, 2026
4 checks passed
@JamesLawton JamesLawton deleted the feat/signed-release-commits branch April 14, 2026 12:12
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