From 549a579bf3fcd4c0b0617732c0088d6d3ad6d750 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Wed, 3 May 2023 10:24:41 -0700 Subject: [PATCH] fix: remove `pr:e2e:couchdb` label on run completion (#6628) * fix: trigger e2e-couchdb run on sync * fix: remove `e2e-couchdb` label if present after run * fix: remove `synchronize` trigger - this is intended behavior * refactor: update GHA to use octokit action * docs: add note about GHA warnings * fix: remove `pr:e2e` label after run * fix: use github-script --- .github/workflows/e2e-couchdb.yml | 13 +++++++++++++ .github/workflows/e2e-pr.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/e2e-couchdb.yml b/.github/workflows/e2e-couchdb.yml index ccd496d0bd..eb3f6b5583 100644 --- a/.github/workflows/e2e-couchdb.yml +++ b/.github/workflows/e2e-couchdb.yml @@ -41,3 +41,16 @@ jobs: uses: actions/upload-artifact@v3 with: path: html-test-results + - name: Remove pr:e2e:couchdb label (if present) + if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:couchdb') }} + uses: actions/github-script@v6 + with: + script: | + const { owner, repo, number } = context.issue; + const labelToRemove = 'pr:e2e:couchdb'; + await github.rest.issues.removeLabel({ + owner, + repo, + issue_number: number, + name: labelToRemove + }); diff --git a/.github/workflows/e2e-pr.yml b/.github/workflows/e2e-pr.yml index 5e57bf2085..3c6f5accc6 100644 --- a/.github/workflows/e2e-pr.yml +++ b/.github/workflows/e2e-pr.yml @@ -66,3 +66,16 @@ jobs: repo: "openmct", body: 'Failure ❌ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId }) + - name: Remove pr:e2e label (if present) + if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e') }} + uses: actions/github-script@v6 + with: + script: | + const { owner, repo, number } = context.issue; + const labelToRemove = 'pr:e2e'; + await github.rest.issues.removeLabel({ + owner, + repo, + issue_number: number, + name: labelToRemove + });