Skip to content

Commit f7141f2

Browse files
committed
ci: skip dist push on main branch [skip test]
1 parent 06230ec commit f7141f2

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Diff for: .github/workflows/CI.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1111
cancel-in-progress: true
1212

1313
env:
@@ -51,11 +51,16 @@ jobs:
5151
- name: Update Dist
5252
run: |
5353
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
54-
git config user.name "github-actions[bot]"
55-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
56-
git add dist/
57-
git commit -m "chore(build): update dist"
58-
git push
54+
if [[ "${{ github.ref_name }}" =~ ^refs/heads/ ]]; then
55+
git config user.name "github-actions[bot]"
56+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57+
58+
git add dist/
59+
git commit -m "chore(build): update dist"
60+
git push
61+
else
62+
echo "Skipping push for non-branch commit"
63+
fi
5964
fi
6065
env:
6166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)