Skip to content

Commit

Permalink
ci: skip dist push on main branch [skip test]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 7, 2025
1 parent 06230ec commit f7141f2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit f7141f2

Please sign in to comment.