pr-remove-waiting-label: suppress failure on 404 errors

this usually means the label wasn't on the PR in the first place
This commit is contained in:
Dylan T. 2024-11-23 21:48:30 +00:00 committed by GitHub
parent 5b72f202bf
commit 7460e12b6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,9 +16,18 @@ jobs:
github-token: ${{ github.token }}
script: |
const [owner, repo] = context.payload.repository.full_name.split('/');
try {
await github.rest.issues.removeLabel({
owner: owner,
repo: repo,
issue_number: context.payload.number,
name: "Status: Waiting on Author",
});
} catch (error) {
if (error.status === 404) {
//probably label wasn't set on the issue
console.log('Failed to remove label (probably label isn\'t on the PR): ' + error.message);
} else {
throw error;
}
}