Skip to content

CI: Create a release PR from the release workflow - #128

Open
pniedzielski wants to merge 1 commit into
bloomberg:mainfrom
pniedzielski:ci/release-pr
Open

pniedzielski wants to merge 1 commit into
bloomberg:mainfrom
pniedzielski:ci/release-pr

Conversation

@pniedzielski

Copy link
Copy Markdown
Contributor

This patch makes the Prepare Release workflow generate a pull request after bumping the version. Right now, there is no automation to publish a release to GitHub and PyPI when a PR is approved and merged.

We use the peter-evans/create-pull-request GitHub Action to make this easier. While this introduces an external dependency, it handles idempotency in case this workflow is run multiple times for the same release version, and also gives us a more declarative syntax for generating PRs.

When this PR is created, it will be authored by github-actions[bot] and include only the version bump and the towncrier changes. Unfortunately, PRs generated by GitHub Actions get their own workflows queued in an “approval-required” state, which means someone will have to click a button on the PR to run the CI. This is to avoid infinite chains of CI workflows being run automatically with no human involved. We can provide a separate token, which we can generate independently and store as a secret, which is not subject to this restriction if we find it annoying. See the GitHub docs on this for more details.

This patch makes the Prepare Release workflow generate a pull request
after bumping the version.  Right now, there is no automation to publish
a release to GitHub and PyPI when a PR is approved and merged.

We use the `peter-evans/create-pull-request` GitHub Action to make this
easier.  While this introduces an external dependency, it handles
idempotency in case this workflow is run multiple times for the same
release version, and also gives us a more declarative syntax for
generating PRs.

When this PR is created, it will be authored by `github-actions[bot]`
and include only the version bump and the towncrier changes.
Unfortunately, PRs generated by GitHub Actions get their own workflows
queued in an “approval-required” state, which means someone will have to
click a button on the PR to run the CI.  This is to avoid infinite
chains of CI workflows being run automatically with no human involved.
We can provide a separate token, which we can generate independently and
store as a secret, which is not subject to this restriction if we find
it annoying.  See [the GitHub docs on this](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow)
for more details.
@pniedzielski
pniedzielski requested a review from a team as a code owner November 10, 2026 19:00
@pniedzielski pniedzielski added skip news No news entry is required github_actions Pull requests that update GitHub Actions code labels Nov 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code skip news No news entry is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant