Skip to content

Commit cf07403

Browse files
committed
fix: scope dependabot-auto-merge's critical-vuln-gate check to main-bound PRs only
1 parent 7d5257c commit cf07403

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ permissions:
3131

3232
jobs:
3333
vuln-gate:
34-
if: ${{ github.actor == 'dependabot[bot]' }}
34+
if: ${{ github.actor == 'dependabot[bot]' && github.event.pull_request.base.ref == 'main' }}
3535
uses: simplify9/.github/.github/workflows/critical-vuln-gate.yml@main
3636
secrets:
3737
dependabot-alerts-token: ${{ secrets.DEPENDABOT_ALERTS_TOKEN }}
3838

3939
auto-merge:
4040
needs: vuln-gate
41-
if: ${{ github.actor == 'dependabot[bot]' }}
41+
# needs: vuln-gate normally skips this job if vuln-gate itself was skipped
42+
# (base.ref != 'main') -- always() overrides that, then the boolean logic
43+
# below re-applies the real gate: a develop-bound PR never needed
44+
# vuln-gate to run at all, a main-bound PR still requires it to succeed.
45+
if: |
46+
always() &&
47+
github.actor == 'dependabot[bot]' &&
48+
(github.event.pull_request.base.ref != 'main' || needs.vuln-gate.result == 'success')
4249
runs-on: ubuntu-latest
4350
timeout-minutes: 5
4451
steps:

0 commit comments

Comments
 (0)