Skip to content

Commit 4147cad

Browse files
committed
use push action
1 parent b74f953 commit 4147cad

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/python-publish.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,14 @@ jobs:
4747
user: __token__
4848
password: ${{ secrets.PYPI_API_TOKEN }}
4949

50-
- name: Commit and push changes
50+
- name: Commit files
5151
run: |
52-
# Get the default branch name (usually main or master)
53-
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
54-
55-
# Checkout the default branch
56-
git checkout $DEFAULT_BRANCH
57-
58-
# Update the file again (as checking out might have reverted it)
59-
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
60-
61-
# Stage, commit and push
62-
git add pyproject.toml
63-
git commit -m "chore: update version to $VERSION [skip ci]"
64-
git push origin $DEFAULT_BRANCH
52+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
53+
git config --local user.name "github-actions[bot]"
54+
git commit -a -m "Update toml version"
55+
56+
- name: Push changes
57+
uses: ad-m/github-push-action@master
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)