ci: skip dist push on main branch [skip test]

This commit is contained in:
Amin Yahyaabadi 2025-02-07 12:34:05 -08:00
parent 06230ecbcd
commit f7141f2b69
1 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,7 @@ on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
@ -51,11 +51,16 @@ jobs:
- name: Update Dist
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore(build): update dist"
git push
if [[ "${{ github.ref_name }}" =~ ^refs/heads/ ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dist/
git commit -m "chore(build): update dist"
git push
else
echo "Skipping push for non-branch commit"
fi
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}