Avoid failing label removal if label is not there
@@ -29,6 +29,14 @@ jobs:
labels: ['severity: fips change']
});
} else if ( artifacts.data.artifacts[0].name == 'fips_unchanged' ) {
+ var labels = await github.issues.listLabelsOnIssue({
+ issue_number: ${{ github.event.workflow_run.pull_requests[0].number }},
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ });
+
+ for ( var label in labels.data ) {
+ if (labels.data[label].name == 'severity: fips change') {
github.issues.removeLabel({
issue_number: ${{ github.event.workflow_run.pull_requests[0].number }},
owner: context.repo.owner,
@@ -36,3 +44,5 @@ jobs:
name: 'severity: fips change'
});
}
+ }
+ }
