fix: handle error when trying to remove a label that does not exist

This commit is contained in:
Levente Balogh
2021-12-14 16:43:06 +01:00
parent fcdbbf45c6
commit 6a6d8fccd9
+10 -6
View File
@@ -83,12 +83,16 @@ jobs:
PR_NUMBER: ${{ steps.finder.outputs.pr }} PR_NUMBER: ${{ steps.finder.outputs.pr }}
with: with:
script: | script: |
github.rest.issues.removeLabel({ try {
issue_number: process.env.PR_NUMBER, github.rest.issues.removeLabel({
owner: context.repo.owner, issue_number: process.env.PR_NUMBER,
repo: context.repo.repo, owner: context.repo.owner,
name: 'breaking change' repo: context.repo.repo,
}) name: 'breaking change'
})
} catch () {
console.log('"breaking change" label does not exist on the PR.')
}
- name: Exit - name: Exit
run: exit ${{ env.BREAKING_CHANGES_IS_BREAKING }} run: exit ${{ env.BREAKING_CHANGES_IS_BREAKING }}