Skip to content

Commit

Permalink
Try extracting trigger label name to workspace env context
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Nov 30, 2020
1 parent 3a3586d commit e0f407b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pr-approved.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- edited
- dismissed

env:
PR_APPROVED_LABEL_NAME: 'ci:approved'

jobs:
check-approved:
name: Check if PR is approved
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e0f407b

Please sign in to comment.