Skip to content

Commit

Permalink
Remove a loop where commits generated trigger the workflow again
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Feb 23, 2022
1 parent 52502f0 commit 2a07c15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/dependabot-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Compile dependabot updates

on:
workflow_dispatch:
pull_request:

permissions:
Expand All @@ -10,7 +9,10 @@ permissions:
jobs:
fetch-dependabot-metadata:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
# We only want to check the metadata on pull_request events from Dependabot itself,
# any subsequent pushes to the PR should just skip this step so we don't go into
# a loop on commits created by the `build-dependabot-changes` job
if: ${{ github.actor == 'dependabot[bot]' }}
# Map the step output to a job output for subsequent jobs
outputs:
dependency-type: ${{ steps.dependabot-metadata.outputs.dependency-type }}
Expand All @@ -25,6 +27,7 @@ jobs:
needs: [fetch-dependabot-metadata]
if: ${{ needs.fetch-dependabot-metadata.outputs.dependency-type == 'direct:production' }}
steps:
# Check out using a PAT so any pushed changes will trigger checkruns
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
Expand Down

0 comments on commit 2a07c15

Please sign in to comment.