-
Notifications
You must be signed in to change notification settings - Fork 17
101 lines (100 loc) · 3.94 KB
/
checkbox-trigger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
name: Checkbox Pipeline Validation
on:
pull_request:
types: [edited]
jobs:
check-description-checkbox:
runs-on: [ k8-runners ]
if: contains(github.event.pull_request.body, '- [x] Automated Validation (Do not edit, check to begin Validation)') && contains(github.event.pull_request.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.pull_request.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-description-checkbox ]
if: needs.check-description-checkbox.outputs.group_dir && needs.check-description-checkbox.outputs.runner_label
uses: ./.github/workflows/container-pipeline-tester.yaml
with:
group_dir: ${{ needs.check-description-checkbox.outputs.group_dir }}
env_overrides: ${{ needs.check-description-checkbox.outputs.env_overrides || '' }}
runner_label: ${{ needs.check-description-checkbox.outputs.runner_label }}
secrets: inherit
status-check:
needs: [ check-description-checkbox, container-pipeline-tester ]
if: ${{ always() && needs.check-description-checkbox.result != 'skipped' }}
runs-on: [ k8-runners ]
steps:
- name: Unlock
if: ${{ needs.check-description-checkbox.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-description-checkbox.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-description-checkbox.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']
})