-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.26 KB
/
approve-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
34
35
36
37
38
39
40
41
42
43
# SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
# @example=## Dependabot Approver Sample
## SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC
## SPDX-License-Identifier: Apache-2.0
#---
#name: 'Approve Dependabot'
#
#on:
# pull_request_target:
#
#jobs:
# dependabot:
# uses: xmidt-org/shared-go/.github/workflows/ci.yml@6a0bec30f42c318c0c1d06705f3f60911ed7c610 # v3.2.0
# secrets: inherit
---
name: 'Approve Dependabot Workflow'
on:
workflow_call:
jobs:
dependabot:
permissions:
pull-requests: write
contents: write
runs-on: [ ubuntu-latest ]
# Checking the actor will prevent your Action run failing on non-Dependabot
# PRs but also ensures that it only does work for Dependabot PRs.
if: |
github.actor == 'dependabot[bot]'
steps:
# The real protection is in dependabot configuration and that the repo
# builds, runs tests and they succeed.
- name: Approve a PR & mark for auto apply.
run: |
gh pr merge --auto --squash "$PR_URL"
gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}