Skip to content

Commit faa691d

Browse files
Improve workflow condition robustness and uv.lock update logic
Co-authored-by: jacksonpradolima <[email protected]>
1 parent 079dea6 commit faa691d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Semantic Release and Publish
1818
runs-on: ubuntu-latest
1919
concurrency: release
20-
if: "github.event_name == 'workflow_dispatch' || !contains(github.event.head_commit.message, 'chore(release):')"
20+
if: "github.event_name == 'workflow_dispatch' || (github.event.head_commit && !contains(github.event.head_commit.message, 'chore(release):'))"
2121
environment:
2222
name: pypi
2323
url: https://pypi.org/project/gsppy/
@@ -74,9 +74,13 @@ jobs:
7474
if: steps.release.outputs.released == 'true'
7575
run: |
7676
uv lock
77-
git add uv.lock
78-
git commit -m "chore: update uv.lock for version ${{ steps.release.outputs.version }}"
79-
git push
77+
if ! git diff --quiet uv.lock; then
78+
git add uv.lock
79+
git commit -m "chore: update uv.lock for version ${{ steps.release.outputs.version }}"
80+
git push
81+
else
82+
echo "uv.lock is already up to date"
83+
fi
8084
8185
- name: Build package
8286
if: steps.release.outputs.released == 'true'

0 commit comments

Comments
 (0)