Skip to content

Commit 766acab

Browse files
committed
fix: Update GitHub Actions workflow to improve commit handling and permissions
1 parent 061161e commit 766acab

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/build-publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
build:
1313
name: Compile and Commit dist/
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
1517

1618
steps:
1719
- name: ⬇️ Checkout repo
@@ -38,8 +40,13 @@ jobs:
3840
3941
- name: 📤 Commit dist files
4042
run: |
41-
git config --global user.name "github-actions"
42-
git config --global user.email "actions@github.com"
43+
git config --global user.name "github-actions[bot]" # It's common to append [bot]
44+
git config --global user.email "github-actions[bot]@users.noreply.github.com" # Use a noreply email
4345
git add dist
44-
git commit -m "📦 Update dist folder [skip ci]" || echo "No changes to commit"
45-
git push
46+
# Check if there are changes to commit
47+
if git diff --staged --quiet; then
48+
echo "No changes to commit"
49+
else
50+
git commit -m "📦 Update dist folder [skip ci]"
51+
git push
52+
fi

0 commit comments

Comments
 (0)