Review Pipeline Validation #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Review Pipeline Validation | |
on: | |
pull_request_review: | |
types: [submitted, edited] | |
permissions: | |
actions: read | |
checks: read | |
contents: read | |
deployments: read | |
discussions: read | |
id-token: write | |
issues: read | |
packages: read | |
pages: read | |
pull-requests: write | |
repository-projects: read | |
security-events: read | |
statuses: read | |
jobs: | |
check-review: | |
runs-on: [ k8-runners ] | |
if: contains(github.event.review.body, '/test-group') && !contains(github.event.pull_request.labels.*.name, 'validating') | |
outputs: | |
group_dir: ${{ steps.comment-inputs.outputs.group_dir }} | |
env_overrides: ${{ steps.comment-inputs.outputs.env_overrides }} | |
runner_label: ${{ steps.comment-inputs.outputs.runner_label }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Inputs | |
id: comment-inputs | |
run: bash .github/utils/val-args.sh "${{ github.event.review.body }}" | |
- name: Remove PASS Label | |
if: contains(github.event.pull_request.labels.*.name, 'PASS') | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: ["PASS"] | |
}) | |
- name: Remove FAIL Label | |
if: contains(github.event.pull_request.labels.*.name, 'FAIL') | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: ["FAIL"] | |
}) | |
- name: Lock | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['validating'] | |
}) | |
container-pipeline-tester: | |
needs: [ check-review ] | |
if: needs.check-review.outputs.group_dir && needs.check-review.outputs.runner_label | |
uses: ./.github/workflows/container-pipeline-tester.yaml | |
with: | |
group_dir: ${{ needs.check-review.outputs.group_dir }} | |
env_overrides: ${{ needs.check-review.outputs.env_overrides || '' }} | |
runner_label: ${{ needs.check-review.outputs.runner_label }} | |
secrets: inherit | |
status-check: | |
needs: [ check-review, container-pipeline-tester ] | |
if: ${{ always() && needs.check-review.result != 'skipped' }} | |
runs-on: [ k8-runners ] | |
steps: | |
- name: Unlock | |
if: ${{ needs.check-review.result != 'skipped' }} | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: ["validating"] | |
}) | |
- name: Set Fail Label | |
if: ${{ needs.check-review.result != 'success' || needs.container-pipeline-tester.result != 'success' }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['FAIL'] | |
}) | |
- name: Set Pass Label | |
if: ${{ needs.check-review.result == 'success' && needs.container-pipeline-tester.result == 'success' }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['PASS'] | |
}) |