Skip to content

Commit 3c94390

Browse files
author
Drew Yang
committed
fix: 🐛 fix update version.py
1 parent d5239e8 commit 3c94390

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/post_release.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
permissions:
1717
# write permission is required to update version.py
1818
contents: write
19+
pull-requests: write
1920
runs-on: ubuntu-latest
2021
steps:
2122
- name: Checkout repository
@@ -29,11 +30,23 @@ jobs:
2930
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" datajoint/version.py
3031
cat datajoint/version.py
3132
# Commit the changes
33+
BRANCH_NAME="update-version-$VERSION"
34+
git checkout -b $BRANCH_NAME
3235
git config --global user.name "github-actions"
3336
git config --global user.email "github-actions@github.com"
3437
git add datajoint/version.py
3538
git commit -m "Update version.py to $VERSION"
36-
git push
39+
git push origin $BRANCH_NAME
40+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
41+
echo "VERSION=$VERSION" >> $GITHUB_ENV
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v6
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
branch: ${{ env.BRANCH_NAME }}
47+
title: "Update version.py to ${{ github.event.release.name }}"
48+
body: "This PR updates `version.py` to match the latest release: ${{ github.event.release.name }}"
49+
base: master
3750
slack-notification:
3851
runs-on: ubuntu-latest
3952
steps:

0 commit comments

Comments
 (0)