forked from hackforla/website
-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (31 loc) · 1.12 KB
/
pr-verification.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
name: Pull Request Verification
on:
pull_request:
types: [opened]
jobs:
Check-Team-Membership:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
# Check if PR author is team member
- name: Verify membership
id: verify-membership
uses: actions/github-script@v7
with:
github-token: ${{ secrets.HACKFORLA_ADMIN_TOKEN }}
script: |
const prAuthor = context.payload.sender.login;
const team = 'website-write';
const script = require('./github-actions/utils/check-team-membership.js');
membershipStatus = script({ github, context }, team, prAuthor);
return membershipStatus
# If PR author not a team member, comment and close PR
- if: ${{ steps.verify-membership.outputs.result == 'true' }}
name: Comment and Close PR
id: comment-and-close-pr
uses: actions/github-script@v7
with:
script: |
const script = require('./github-actions/trigger-pr-target/verify-pr.js');
script({ g: github, c: context })