-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract
bump-changelog
action into separate workflow
- Loading branch information
Showing
3 changed files
with
53 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Bump changelog before release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to be released' | ||
required: true | ||
type: string | ||
|
||
env: | ||
default-python: "3.12" | ||
minimum-supported-python: "3.8" | ||
|
||
jobs: | ||
bump-changelog: | ||
name: Bump changelog | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout ${{ github.ref }} | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ env.default-python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.default-python }} | ||
cache: "pip" | ||
- name: Get release version and construct PR branch | ||
run: | | ||
echo "RELEASE_VERSION=${{ inputs.version }}" >> $GITHUB_ENV | ||
echo "PR_BRANCH=bump-changelog-for-${{ inputs.version }}" >> $GITHUB_ENV | ||
- name: Create pull request branch | ||
run: git switch -c $PR_BRANCH | ||
- name: Install nox | ||
run: python -m pip install nox | ||
- name: Update changelog | ||
run: nox --error-on-missing-interpreters --non-interactive --session build_changelog -- $RELEASE_VERSION | ||
- name: Commit and push change | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git commit -am "Bump changelog for $RELEASE_VERSION" | ||
git push origin $PR_BRANCH | ||
- name: Create pull request | ||
run: | | ||
git fetch origin | ||
gh pr create --base main --fill | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters