diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-05-17 19:00:13 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-05-19 13:08:27 +1000 |
commit | 753f1f24ac18e31eb6feaa9bde752f57a7bde9e7 (patch) | |
tree | 93e709dc5198cd38b42ea96cf13c45479088db00 /.github/workflows | |
parent | a51ccd5be7cef0cb668a5ec98c491676db7714f4 (diff) |
Avoid failing label removal if label is not there
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15309)
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/fips-label.yml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/.github/workflows/fips-label.yml b/.github/workflows/fips-label.yml index 948ff10b3e..536b227260 100644 --- a/.github/workflows/fips-label.yml +++ b/.github/workflows/fips-label.yml @@ -19,7 +19,7 @@ jobs: var artifacts = await github.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + run_id: ${{ github.event.workflow_run.id }}, }); if ( artifacts.data.artifacts[0].name == 'fips_changed' ) { github.issues.addLabels({ @@ -29,10 +29,20 @@ jobs: labels: ['severity: fips change'] }); } else if ( artifacts.data.artifacts[0].name == 'fips_unchanged' ) { - github.issues.removeLabel({ + var labels = await github.issues.listLabelsOnIssue({ issue_number: ${{ github.event.workflow_run.pull_requests[0].number }}, owner: context.repo.owner, repo: context.repo.repo, - name: 'severity: fips change' }); + + 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, + repo: context.repo.repo, + name: 'severity: fips change' + }); + } + } } |