Skip to content

Commit

Permalink
Fix CI pipeline to prevent double triggering for push and pull_reques…
Browse files Browse the repository at this point in the history
…t events
  • Loading branch information
bekiroguz committed Oct 6, 2024
1 parent d440a5c commit d07526d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
contents: write
pull-requests: write
runs-on: ubuntu-latest
# This condition ensures the ci job runs only for push events that are not associated with a pull request (prevents duplicate runs)
if: ${{ github.event_name == 'push' && github.event.pull_request == null }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -100,9 +102,8 @@ jobs:
name: Submit dependency graph
continue-on-error: true
needs: [ci]
# run on 1) master branch
# do not run on pull requests
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
# Submit dependency graph only for the master branch commits
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down

0 comments on commit d07526d

Please sign in to comment.