From e0f407bb47deec187290f3717bd18428b43117f8 Mon Sep 17 00:00:00 2001 From: Ludovico Bianchi Date: Mon, 30 Nov 2020 12:06:44 -0800 Subject: [PATCH] Try extracting trigger label name to workspace env context --- .github/workflows/pr-approved.yml | 5 ++++- .github/workflows/pr-review.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-approved.yml b/.github/workflows/pr-approved.yml index 0523f81ba8..7c8a3bf0e5 100644 --- a/.github/workflows/pr-approved.yml +++ b/.github/workflows/pr-approved.yml @@ -4,11 +4,14 @@ on: pull_request: types: [labeled] +env: + PR_APPROVED_LABEL_NAME: 'ci:approved' + jobs: check-skip: name: check if integration tests should run runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'ci:approved') + if: contains(github.event.pull_request.labels.*.name, env.PR_APPROVED_LABEL_NAME) steps: - name: notify run: echo "The integration tests will run" diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index d9af30369f..f3b4af1791 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -7,6 +7,9 @@ on: - edited - dismissed +env: + PR_APPROVED_LABEL_NAME: 'ci:approved' + jobs: check-approved: name: Check if PR is approved @@ -99,7 +102,7 @@ jobs: console.log(`Label ${labelName} is already in desired state, no further action needed.`); } } - const labelName = "ci:approved"; + const labelName = process.env.PR_APPROVED_LABEL_NAME; await ensureLabelPresence({ labelName: labelName, shouldBePresent: isApproved,