-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.91 KB
/
pr.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Merge PRs
on:
pull_request:
types:
- labeled
permissions:
contents: write
pull-requests: write
jobs:
celsiusnarhwal:
runs-on: ubuntu-latest
environment: production
if: ${{ github.actor == 'celsiusnarhwal' && github.event.label.name == 'privileged' }}
steps:
- name: Get Token
id: nodoka
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.NODOKA_ID }}
private_key: ${{ secrets.NODOKA_PASSWORD }}
- name: Checkout Repository
uses: actions/checkout@v3
- name: Merge PR
run: gh pr merge --auto --merge ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ steps.nodoka.outputs.token }}
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get PR Metadata
id: metadata
uses: dependabot/fetch-metadata@v1
- name: Merge PR
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --merge ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ github.token }}
- name: Flag PR
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-major' }}
run: "gh pr edit --add-assignee celsiusnarhwal --add-reviewer celsiusnarhwal ${{ github.event.pull_request.number }}"
other:
runs-on: ubuntu-latest
if: ${{ github.actor != 'celsiusnarhwal' }}
steps:
- name: Get User Type
id: user
run: echo "type=$(gh api users/${{ github.actor }} --jq '.type')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
- name: Close PR
if: ${{ steps.user.outputs.type != 'Bot' }}
run: gh pr close ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ github.token }}