Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ad724f06
ℹ️ 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".
| env: | ||
| VERSION: ${{ steps.version.outputs.version }} | ||
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} |
There was a problem hiding this comment.
Set GH_TOKEN for changelog PR commands
This step runs gh pr list/gh pr create but does not export an auth token, so on GitHub runners the gh calls will fail authentication when there is changelog content to roll. In the same workflow, earlier gh release commands explicitly set GH_TOKEN: ${{ github.token }}, but that is step-scoped and not available here. Because continue-on-error: true is enabled, the failure is swallowed and the advertised changelog PR automation silently never happens.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds a repository changelog and automates rolling the ## Unreleased section into a versioned release entry during the GitHub release workflow, with a follow-up PR back to the default branch.
Changes:
- Add
CHANGELOG.mdwith an## Unreleasedsection and an initial0.3.0entry. - Add
scripts/roll-changelog.shto move## Unreleasedentries into a## <version>section. - Extend the release workflow to run the roll script and open a PR with the changelog update; update README release instructions accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scripts/roll-changelog.sh |
New bash utility to roll ## Unreleased notes into a versioned changelog section. |
CHANGELOG.md |
Introduces the changelog structure and initial release notes. |
README.md |
Updates the documented release process to include changelog maintenance/automation. |
.github/workflows/witan-cli-release.yml |
Adds permissions and a post-release step to roll the changelog and open a PR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| existing_pr_url="$( | ||
| gh pr list \ | ||
| --base "${DEFAULT_BRANCH}" \ | ||
| --head "${CHANGELOG_BRANCH}" \ | ||
| --state open \ | ||
| --json url \ | ||
| --jq '.[0].url' || true | ||
| )" |
There was a problem hiding this comment.
The changelog roll step calls gh pr list / gh pr create but does not set GH_TOKEN (or GITHUB_TOKEN) for authentication. On GitHub Actions this typically causes gh to fail with an auth error, so the PR will never be created (and continue-on-error: true will mask it). Set GH_TOKEN: ${{ github.token }} for this step (similar to the “Publish release assets” step) so PR creation works reliably.
| 2. Create a GitHub Release in the UI with a new tag `vX.Y.Z` (or prerelease tag `vX.Y.Z-suffix`). | ||
| 3. Tag push triggers `Witan CLI Release`. | ||
| 4. The workflow builds artifacts, attaches them to the GitHub Release, and publishes to PyPI for stable tags. | ||
| 5. On successful release, CI runs `scripts/roll-changelog.sh`, pushes the changelog update to a `chore/changelog-release-X.Y.Z` branch, and opens a PR into the default branch. |
There was a problem hiding this comment.
Release step 5 states the workflow will push a changelog branch and open a PR on every successful release, but the workflow only does this when CHANGELOG.md changes (i.e., ## Unreleased has entries) and the step is marked continue-on-error: true (so failures are best-effort). Update this line to describe the conditional/best-effort behavior so the documented release process matches what CI actually does.
| 5. On successful release, CI runs `scripts/roll-changelog.sh`, pushes the changelog update to a `chore/changelog-release-X.Y.Z` branch, and opens a PR into the default branch. | |
| 5. After a successful release, if `CHANGELOG.md` has entries under `## Unreleased`, CI best-effort runs `scripts/roll-changelog.sh` to roll them into a release section, push the changelog update to a `chore/changelog-release-X.Y.Z` branch, and open a PR into the default branch (this step is marked `continue-on-error` and does not fail the release). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 342fa3ee18
ℹ️ 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".
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | ||
| run: | | ||
| git fetch origin "${DEFAULT_BRANCH}" | ||
| git checkout -B "release-changelog-${GITHUB_RUN_ID}" "origin/${DEFAULT_BRANCH}" |
There was a problem hiding this comment.
Roll changelog from tagged release commit
This step resets to origin/${DEFAULT_BRANCH} before calling roll-changelog.sh, so it rolls whatever is currently in the default branch’s ## Unreleased section rather than what was actually released by the tag. If new commits land on the default branch while the workflow runs (or the tag comes from a different commit), those unreleased notes get incorrectly moved under the just-released version, corrupting release notes. The changelog roll should run against the tagged release ref, not the moving default-branch head.
Useful? React with 👍 / 👎.
No description provided.