-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.09 KB
/
auth-check.yaml
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: Pull Request Authentication Check
on:
pull_request:
branches-ignore:
- 'dependabot/**'
workflow_dispatch:
env:
GITHUB_OAUTH_TOKEN: ${{ secrets.AUTH_CHECK_GITHUB }}
jobs:
check-pr-user:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- id: approve_colab_user
name: Check PR user
uses: docker://jackstock8904/auth-check:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output
run: echo ${{ steps.approve_colab_user.outputs.approve_colab_user }}
- name: Comment on PR if true
uses: actions/github-script@v7
if: steps.approve_colab_user.outputs.approve_colab_user == 'true'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This is a known Colaborator. Please Review this Pull Request.'
});
- name: adding collaborator
uses: docker://jackstock8904/assignee:latest
if: steps.approve_colab_user.outputs.approve_colab_user == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR if false
uses: actions/github-script@v7
if: steps.approve_colab_user.outputs.approve_colab_user == 'false'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This isn't a known Colaborator. This Pull Request will now be closed.'
});
- name: close pull request
uses: docker://jackstock8904/close-pr:latest
if: steps.approve_colab_user.outputs.approve_colab_user == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}