Skip to content

Commit

Permalink
Skip to push and create PRs for no commits
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Sep 27, 2023
1 parent 74157c1 commit dac25a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/update-nixpkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ jobs:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "${PR_BRANCH}"
- run: nix develop --command task update
- name: Count added commits
id: count-commits
run: |
count="$(git rev-list --count main..)"
echo "count=${count}" | tee -a "$GITHUB_OUTPUT"
- run: git push origin "${PR_BRANCH}"
if: github.event_name != 'pull_request'
if: (github.event_name != 'pull_request') && (${{ steps.count-commits.outputs.count }} > 0)
- name: Create PR
if: github.event_name != 'pull_request'
if: (github.event_name != 'pull_request') && (${{ steps.count-commits.outputs.count }} > 0)
env:
GITHUB_TOKEN: ${{ steps.publish-token.outputs.token }}
run: |
Expand Down

0 comments on commit dac25a1

Please sign in to comment.