Skip to content

Commit

Permalink
Update label-on-approval.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm authored Jun 15, 2024
1 parent 9f3f327 commit 5e8d7f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/label-on-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Add Label on Approval

on:
pull_request_review:
types: [ submitted,edited ]
types: [submitted]

permissions:
issues: write
pull-requests: write

jobs:
add-label:
Expand All @@ -15,14 +19,15 @@ jobs:
- name: Check if approval is from Collaborators
id: check_approval
uses: actions/github-script@v7
env:
GITHUB_TOKEN: "${{ secrets.PAT }}"
with:
github-token: ${{ evn.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const { pull_request, review } = context.payload;
if (!review) {
console.log('No review found.');
return;
}
// Define your list of collaborators
const collaborators = ['mxsm', 'TeslaRustor','SpaceXCN']; // Replace with actual GitHub usernames
console.log('review:', review.state);
Expand Down

0 comments on commit 5e8d7f5

Please sign in to comment.