chore: some small changes to try and get the workflow running properly

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-01-18 21:42:16 +01:00
parent 5387ea8f0d
commit 2c2695cc1a
2 changed files with 16 additions and 8 deletions
+1 -6
View File
@@ -1,11 +1,7 @@
# on a PR open on PR review or comment, assign the awaiting-review label if the actor is the author
name: Set Awaiting Review
on:
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created]
pull_request:
pull_request_target:
types: [opened, reopened, synchronize]
permissions:
@@ -19,7 +15,6 @@ jobs:
- uses: actions/github-script@v5
id: fix-labels
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// if it's the author, always add awaiting-review label
const isAuthor = context.payload.pull_request.user.login === context.actor
+15 -2
View File
@@ -91,12 +91,25 @@ module.exports = async ({ github, context, core }) => {
if (hasReviewed.size === expectedReviewers.size) {
await github.rest.issues
.removeLabel({
issue_number: context.issue.number,
issue_number: pullRequest.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'awaiting-review',
})
.catch(() => {});
.catch(e => {
console.error(e);
});
} else {
await github.rest.issues
.addLabels({
issue_number: pullRequest.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['awaiting-review'],
})
.catch(e => {
console.error(e);
});
}
}
};