-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.3 KB
/
check-dependabot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Dependabot PR Check
on: pull_request
jobs:
setup-variables:
name: Set up PR variables
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
outputs:
prVars: ${{ steps.setup-vars.outputs.vars }}
steps:
- id: setup-vars
run: echo "vars={\"prBranch\":\"$(echo $PR_BRANCH)\"}" >> $GITHUB_OUTPUT
env:
PR_BRANCH: ${{ github.head_ref }}
check-if-dependabot-pr:
name: Verify Dependabot PR
needs: setup-variables
runs-on: ubuntu-latest
steps:
- name: Fetch Dependabot PR metadata
id: dependabot-metadata
uses: dependabot/[email protected]
- name: Log action for non-major updates
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: echo "Triggering workflow to auto-merge Dependabot PR with inputs $(echo $INPUTS)"
- name: Auto-merge for non-major updates
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
uses: benc-uk/[email protected]
with:
workflow: dependabot-auto-merge.yml
inputs: ${{ needs.setup-variables.outputs.prVars }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}