Skip to content

Commit

Permalink
Fix single commit check when label did not exist
Browse files Browse the repository at this point in the history
The call to remove a label from a PR fails with 404 if that label did not
exist. We can ignore this error.

[noissue]
  • Loading branch information
mdellweg authored and lubosmj committed Nov 15, 2023
1 parent 228896d commit 1fc3240
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ jobs:
with:
script: |
const { COMMIT_COUNT } = process.env
if (COMMIT_COUNT == 1)
{
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["multi-commit"]
})
try {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["multi-commit"]
})
} catch(err) {
}
}
else
{
Expand Down
16 changes: 10 additions & 6 deletions templates/github/.github/workflows/pr_checks.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ jobs:
with:
script: |
const { COMMIT_COUNT } = process.env

if (COMMIT_COUNT == 1)
{
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["multi-commit"]
})
try {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["multi-commit"]
})
} catch(err) {
}
}
else
{
Expand Down

0 comments on commit 1fc3240

Please sign in to comment.