-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (107 loc) · 4.28 KB
/
operator_test_report_openshift_status.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Report Openshift status
on:
repository_dispatch:
types:
- manual-openshift-report
- openshift-test-status
env:
OPP_PRODUCTION_TYPE: "ocp"
jobs:
remove-add-label:
runs-on: ubuntu-latest
steps:
- name: "Info"
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log(context.payload.client_payload.source_pr)
console.log(context.payload.client_payload.remove_labels)
console.log(context.payload.client_payload.add_labels)
continue-on-error: true
- name: "Remove labels"
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
if (context.payload.client_payload.remove_labels != undefined) {
for (const label of context.payload.client_payload.remove_labels) {
github.issues.removeLabel({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo,
name: label
})
}
}
continue-on-error: true
- name: "Add labels"
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
if (context.payload.client_payload.add_labels != undefined) {
github.issues.addLabels({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo,
labels: context.payload.client_payload.add_labels
})
}
- uses: actions/github-script@v4
id: labels
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = await github.issues.listLabelsOnIssue({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo
})
console.log(labels.data)
return labels.data
- name: Add installation final label
uses: actions/github-script@v4
if: |
(!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.6')) &&
(!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.7')) &&
(!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.8')) &&
(!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.9')) &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.6')) &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.7')) &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.8')) &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.9'))
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.addLabels({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ 'installation-validated' ]
})
- uses: actions/github-script@v4
id: labels2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = await github.issues.listLabelsOnIssue({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo
})
console.log(labels.data)
return labels.data
- uses: actions/github-script@v4
if: |
(contains(fromJSON(steps.labels2.outputs.result).*.name, 'installation-validated'))
with:
github-token: ${{ secrets.FRAMEWORK_MERGE }}
script: |
github.issues.createComment({
issue_number: context.payload.client_payload.source_pr,
owner: context.repo.owner,
repo: context.repo.repo,
body: '/merge possible'
})