Skip to content

Commit 145a5a1

Browse files
authored
use release target branch instead of main
1 parent 9866504 commit 145a5a1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/pypi.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060

6161
permissions:
6262
id-token: write # required to push with trusted-pypi-token
63+
64+
env:
65+
BRANCH: ${{ github.event.release.target_commitish }}
6366

6467
steps:
6568
- name: Set up Python 3.12
@@ -87,10 +90,10 @@ jobs:
8790
contents: write # required to push with GITHUB_TOKEN
8891

8992
steps:
90-
- name: Checkout main branch
93+
- name: Checkout release target branch
9194
uses: actions/checkout@v4
9295
with:
93-
ref: main
96+
ref: $BRANCH
9497

9598
- name: Set up Python 3.12
9699
uses: actions/setup-python@v5
@@ -120,8 +123,8 @@ jobs:
120123
echo "No changes to commit"
121124
fi
122125
123-
- name: Push commit to main
126+
- name: Push commit to branch
124127
# GITHUB_TOKEN is automatically provided
125128
run: |
126129
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
127-
git push origin main
130+
git push origin HEAD:$BRANCH

0 commit comments

Comments
 (0)