fix(ci): repair contributor gate handling
This commit is contained in:
parent
3e85f0e6a3
commit
8b7cd9f067
|
|
@ -2,7 +2,7 @@ name: PR Gate
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, closed, reopened, synchronize]
|
types: [opened, closed, reopened]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: pr-gate-${{ github.event.pull_request.number }}
|
group: pr-gate-${{ github.event.pull_request.number }}
|
||||||
|
|
@ -120,12 +120,16 @@ jobs:
|
||||||
|
|
||||||
async function removeReviewLabel() {
|
async function removeReviewLabel() {
|
||||||
if (!(await currentLabels()).has(REVIEW_LABEL)) return;
|
if (!(await currentLabels()).has(REVIEW_LABEL)) return;
|
||||||
await github.rest.issues.removeLabelForIssue({
|
try {
|
||||||
owner: context.repo.owner,
|
await github.request('DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}', {
|
||||||
repo: context.repo.repo,
|
owner: context.repo.owner,
|
||||||
issue_number: pullNumber,
|
repo: context.repo.repo,
|
||||||
name: REVIEW_LABEL,
|
issue_number: pullNumber,
|
||||||
});
|
name: REVIEW_LABEL,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status !== 404) throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function upsertGateComment(message) {
|
async function upsertGateComment(message) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue