Repository navigation
feat(release): add shared release-pr and release-publish workflows - #20
Conversation
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Split the release steps into release-pr.yml (release-please with the release App token) and release-publish.yml (verify the tag, attest, upload and publish the draft). Callers keep only their build job and pass the files as a workflow artifact. release_please.yml now calls release-pr.yml, so this repository exercises it. Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| `release.yml` runs on every push to `main`, in three jobs: | ||
|
|
||
| 1. `release-pr` (`release-pr.yml`) opens or updates the release PR. When the PR is merged it creates the tag and a | ||
| **draft** release, and outputs `release_created` and `tag_name`. |
There was a problem hiding this comment.
P2: This flow needs release-please config that callers have to set themselves, and the README doesn't say so. By default release-please publishes the release right away, and GitHub doesn't create the git tag for a draft release. To get "the tag and a draft release", the caller's release-please-config.json must set "draft": true and "force-tag-creation": true.
What happens if either one is missing:
- Without
draft: true, the release is already published, sorelease-publishalways fails at theisDraftcheck. - Without
force-tag-creation: true, the tag doesn't exist. Thebuildcheckout ofref: tag_namefails, and so doesgh api repos/$GH_REPO/commits/$TAG_NAME.
Please list both settings in this section, for example next to the config-file / manifest-file note.
There was a problem hiding this comment.
Fixed in 98d7c72: the README now states that the caller config must set "draft": true and "force-tag-creation": true, and why.
Review summaryBlocking findings: 0 (P0: 0, P1: 0, P2: 1)
What I checked and found no problem with:
These are workflow-only changes, so the real test is a release run, which the PR already plans after merge. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b48d93d234
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| config-file: ${{ inputs.config-file }} | ||
| manifest-file: ${{ inputs.manifest-file }} |
There was a problem hiding this comment.
Require release-please to create draft releases
Callers following the documented setup can use an ordinary release-please config, where draft defaults to false; the action therefore publishes the release immediately, and release-publish.yml then always rejects it at the isDraft check before attaching artifacts. This repository's own unchanged config demonstrates that the default configuration does not satisfy the new workflow contract. Require or validate draft: true in the caller's config before exposing release_created; the release-please schema documents that releases are published by default.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 98d7c72 by documenting the requirement. Validating it in release-pr.yml is not possible: the config is the caller file and release-please owns the draft behavior. release-publish.yml already fails with a clear message at the isDraft check, and agent-harness already sets draft: true.
| - uses: actions/checkout@<full-commit-sha> # <ref> | ||
| with: | ||
| persist-credentials: false | ||
| ref: ${{ needs.release-pr.outputs.tag_name }} |
There was a problem hiding this comment.
Require eager tag creation for draft releases
When the caller corrects the first prerequisite by enabling draft releases, the documented build still cannot check out this ref unless the release-please config also enables force-tag-creation: by default GitHub does not create the Git tag for a draft until it is published. Consequently the checkout here fails before artifacts are built, and the publisher's gh api .../commits/$TAG_NAME check would fail as well. Require or document force-tag-creation: true alongside draft mode; the release-please CLI documentation explicitly describes this draft-tag behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 98d7c72: the README requires "force-tag-creation": true next to "draft": true. agent-harness already sets both in its config.
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary (read-only) No blocking findings. I checked:
Two minor, non-blocking notes:
These are workflows, so there are no automated tests. The PR says end-to-end checks will happen after merge and in the agent-harness migration, which is reasonable here. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98d7c72603
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| release_created: ${{ steps.release.outputs.release_created }} | ||
| tag_name: ${{ steps.release.outputs.tag_name }} |
There was a problem hiding this comment.
Handle path-prefixed release outputs
When the supplied manifest has a package outside the root path—or multiple packages—release-please does not populate these unprefixed outputs; it emits path-prefixed outputs such as <path>--release_created and <path>--tag_name instead, as documented in the release-please action outputs. The workflow can therefore create one or more draft releases but report an empty release_created/tag_name, causing the documented build and publish jobs to skip and leaving those releases stranded as drafts. Either explicitly restrict this reusable workflow to a single root component or provide a way to select and expose the path-prefixed outputs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI found no blocking issues. I didn't post any inline comments. What I checked:
Non-blocking notes:
Blocking findings (P0/P1): 0 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ea64cc850
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Together they release a repository with release-please, draft releases and immutable releases. A caller's | ||
| `release.yml` runs on every push to `main`, in three jobs: |
There was a problem hiding this comment.
Require callers to enable immutable releases
When a caller has not independently enabled GitHub's repository-level immutable-releases setting, these jobs only publish an ordinary release: the draft check prevents this workflow from overwriting an already-published release, but it does not stop users or other tokens from later changing or deleting its tag and assets. Because the documented setup never lists that repository setting as a prerequisite, following it does not provide the immutability promised here; document that callers must enable the setting or avoid claiming the resulting releases are immutable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8c3fcc8: the README now says the workflows only draft, attest and publish, and that the caller must enable the repository immutable releases setting before the first release.
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
|
||
| # Provenance names the commit of this run, so the tag must point to it. | ||
| tag_sha="$(gh api "repos/$GH_REPO/commits/$TAG_NAME" --jq .sha)" | ||
| if [[ "$tag_sha" != "$GITHUB_SHA" ]]; then | ||
| echo "$TAG_NAME points to $tag_sha, but this run is for $GITHUB_SHA." |
There was a problem hiding this comment.
P2: A draft can get stuck with no way to recover.
The README example uses concurrency: group: release-… with cancel-in-progress: false. GitHub keeps only one pending run per group, so a newer pending run cancels an older one. Here is the failure:
- The push of the release-PR merge commit M is queued behind a running release run.
- Someone pushes commit B before M's run starts, so M's pending run is cancelled.
- B's run calls release-please. It sees the merged
autorelease: pendingPR and creates the tag and draft at M. buildchecks out the tag and passes. This check then fails, becausetag_sha(M) differs fromGITHUB_SHA(B).
Re-running the job does not help because GITHUB_SHA is still B. The release stays a draft until someone steps in by hand.
The same thing happens when M and B arrive in one push. Possible fixes: document a recovery path, such as a workflow_dispatch on the tag that calls release-publish.yml. Or detect the case early in release-pr and fail with a clear message.
There was a problem hiding this comment.
Fixed in 72817ef by documenting a recovery path: the README example now has a workflow_dispatch trigger that builds and publishes a given draft tag when run on that tag (GITHUB_SHA is then the tagged commit), with the gh workflow run command. The check in release-publish.yml stays, because provenance must name the tagged commit. Not verified end to end yet.
Review summaryI found no P0 or P1 issues. The tag/SHA check, the draft-only check before
Tests: nothing in CI exercises |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c3fcc8c51
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| path: release-artifacts | ||
|
|
||
| - name: Attest release artifacts | ||
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 |
There was a problem hiding this comment.
Document the private-repository plan requirement
When a caller is a private or internal repository on GitHub Free, Pro, or Team, this attestation step is unavailable and fails before the assets are uploaded or the draft is published. The pinned action's documentation says private/internal repositories require GitHub Enterprise Cloud, but the reusable workflow is currently documented without that prerequisite; document this restriction so private callers do not adopt a release flow that cannot complete.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 72817ef: the README states that attestation needs a public repository, or GitHub Enterprise Cloud for private and internal ones, so release-publish.yml is not usable from a private repository on Free, Pro or Team.
…ry requirement Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI found no blocking issues and posted no inline comments. What I checked:
Not covered by tests: Blocking findings (P0/P1): 0 |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Workflow file names use kebab-case, as GitHub Actions and release-please-action do. Replace the ls-lint workflow name list with one kebab-case rule and update the README. Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary: I found no blocking or minor issues. What I checked:
As the PR notes, the end-to-end release behaviour can only be checked by a real release after merge. Nothing in the repo can exercise 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 463338e7db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
|
|
||
| shopt -s nullglob | ||
| files=(release-artifacts/*) |
There was a problem hiding this comment.
Handle nested files before uploading release assets
When the workflow artifact contains a subdirectory, which the documented dist/* upload can produce because upload-artifact preserves hierarchy after the wildcard, this glob adds the directory itself rather than its contained files. The subsequent gh release upload <tag> <files>... accepts asset files, so it fails on that directory and leaves the release as a draft. Either collect regular files recursively and define how their names are flattened, or explicitly require and validate a flat artifact.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e701f13 by requiring a flat artifact: the README now says the artifact holds regular files only, no subdirectories, and that the upload-artifact path must match files. The workflow already fails loudly on a directory, before publishing, and the draft stays recoverable, so I did not add flattening logic that would have to define how names are rewritten.
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e701f138a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
|
|
||
| shopt -s nullglob | ||
| files=(release-artifacts/*) |
There was a problem hiding this comment.
Include dotfiles when collecting release assets
When a flat artifact contains both an ordinary file and a dotfile, Bash's default * expansion omits the dotfile even though it satisfies the documented regular-files-only contract. The workflow therefore uploads and publishes the visible assets while silently leaving the dotfile out, and an immutable release cannot then be repaired; enable dotglob or explicitly reject dotfiles before publication.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not a defect, no change: actions/upload-artifact excludes hidden files by default (include-hidden-files: false, since v4.4), so a dotfile never reaches the artifact and cannot be silently left out here. Anything that contains a dotfile must opt in on the upload side, and the artifact is the contract that the README documents (regular files, flat).
Refs #11 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary: no P0–P3 findings. What I checked:
Caveat: 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [1.2.0](v1.1.0...v1.2.0) (2026-11-09) ### Features * **release:** add shared release-pr and release-publish workflows ([#20](#20)) ([5f7ab9f](5f7ab9f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
release の手順を共有 workflow 2 つ(
release-pr.yml,release-publish.yml)にした.ビルドは各 repo のジョブに残し,成果物は workflow artifact で渡す.agent-harness と rater の移行は,この PR の release 後に 1 本ずつ行う(Refs #11).計画コメント
flowchart LR A[push to main] --> B[release-pr.yml<br/>release PR / draft release] B -->|release_created, tag_name| C[caller build job<br/>upload-artifact] C --> D[release-publish.yml<br/>verify, attest, upload, publish]release_please.ymlrelease-pr.yml(App token)release_artifacts.ymlrelease-publish.ymlworkflow_dispatchGITHUB_SHAの一致を検査)release_please.ymlrelease-pr.ymlを呼ぶ移行 PR の前提(ユーザーの作業)
RELEASE_APP_CLIENT_IDと secretRELEASE_APP_PRIVATE_KEYを登録済み(ユーザー確認済み)RELEASE_PLEASE_TOKENを削除する検証
actionlint:指摘なしzizmor .github/workflows:指摘なしrelease-pr.ymlを確認し,release-publish.ymlは agent-harness の移行 PR で確認するレビュー対応:呼び出し側の release-please config に
draft: trueとforce-tag-creation: trueが必要なこと,ルート(.)の単一 package のみ対応であること,immutable releases の設定が必要なこと,attestation に public repo(または GitHub Enterprise Cloud)が必要なことを README に明記した.tag と実行 commit がずれて draft が残る場合の復旧手順(workflow_dispatchを tag 上で実行)も README の例に追加した(未検証,agent-harness の移行 PR で確認する).追加(ユーザー判断):
release_please.ymlをrelease-please.ymlに改名し,.ls-lint.ymlの workflow 名の規則を kebab-case 1 本にした(README に「workflow file names use kebab-case」を追記).artifact は flat(通常ファイルのみ,サブディレクトリと隠しファイルなし)が前提であることも README に明記した.計画からの変更:なし.
前提と補足
release-publish.yml(固定 SHA)になる.従来は各 repo のrelease_artifacts.ymlcmd/rater/version.txtと tag の一致検査は repo 固有なので rater の build ジョブに残す.ls-lint.ymlに新しい workflow 名を追加(pre-commit が拒否したため)templates/削除(Issue の残りの受け入れ条件)🤖 Generated with Claude Code