Update verify-pr.js #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 script = require('./github-actions/utils/check-team-membership.js'); | |
membershipStatus = script({ github, context }); | |
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 }) | |