Update workflows to use $GITHUB_OUTPUT instead of ::set-output:: (#13960)
* Update workflows to use $GITHUB_OUTPUT instead of ::set-output:: * Fix python code. * Fix handling of python-based build matrix generation.
Austin S. Hemmelgarn committed
Dec 2, 2022 at 10:17 UTC
cf199ac0344a6e77ca76879f70d883ddaf1ca6ff
12 files changed
+188
-164
.github/scripts/gen-matrix-build.py
new
+34
@@ -0,0 +1,34 @@
1
+#!/usr/bin/env python3
2
+
3
+import json
4
+
5
+from ruamel.yaml import YAML
6
+
7
+yaml = YAML(typ='safe')
8
+entries = []
9
+
10
+with open('.github/data/distros.yml') as f:
11
+ data = yaml.load(f)
12
+
13
+for i, v in enumerate(data['include']):
14
+ e = {
15
+ 'artifact_key': v['distro'] + str(v['version']).replace('.', ''),
16
+ 'version': v['version'],
17
+ }
18
+
19
+ if 'base_image' in v:
20
+ e['distro'] = ':'.join([v['base_image'], str(v['version'])])
21
+ else:
22
+ e['distro'] = ':'.join([v['distro'], str(v['version'])])
23
+
24
+ if 'env_prep' in v:
25
+ e['env_prep'] = v['env_prep']
26
+
27
+ if 'jsonc_removal' in v:
28
+ e['jsonc_removal'] = v['jsonc_removal']
29
+
30
+ entries.append(e)
31
+
32
+entries.sort(key=lambda k: k['distro'])
33
+matrix = json.dumps({'include': entries}, sort_keys=True)
34
+print(matrix)
.github/scripts/gen-matrix-packaging.py
new
+36
@@ -0,0 +1,36 @@
1
+#!/usr/bin/env python3
2
+
3
+import json
4
+import sys
5
+
6
+from ruamel.yaml import YAML
7
+
8
+ALWAYS_RUN_ARCHES = ["amd64", "x86_64"]
9
+SHORT_RUN = sys.argv[1]
10
+yaml = YAML(typ='safe')
11
+entries = list()
12
+run_limited = False
13
+
14
+with open('.github/data/distros.yml') as f:
15
+ data = yaml.load(f)
16
+
17
+if "${{ github.event_name }}" == "pull_request" and bool(int(SHORT_RUN)):
18
+ run_limited = True
19
+
20
+for i, v in enumerate(data['include']):
21
+ if 'packages' in data['include'][i]:
22
+ for arch in data['include'][i]['packages']['arches']:
23
+ if arch in ALWAYS_RUN_ARCHES or not run_limited:
24
+ entries.append({
25
+ 'distro': data['include'][i]['distro'],
26
+ 'version': data['include'][i]['version'],
27
+ 'repo_distro': data['include'][i]['packages']['repo_distro'],
28
+ 'format': data['include'][i]['packages']['type'],
29
+ 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'],
30
+ 'platform': data['platform_map'][arch],
31
+ 'arch': arch
32
+ })
33
+
34
+entries.sort(key=lambda k: (data['arch_order'].index(k['arch']), k['distro'], k['version']))
35
+matrix = json.dumps({'include': entries}, sort_keys=True)
36
+print(matrix)
.github/scripts/gen-matrix-repoconfig.py
new
+26
@@ -0,0 +1,26 @@
1
+#!/usr/bin/env python3
2
+
3
+import json
4
+
5
+from ruamel.yaml import YAML
6
+
7
+yaml = YAML(typ='safe')
8
+entries = list()
9
+
10
+with open('.github/data/distros.yml') as f:
11
+ data = yaml.load(f)
12
+
13
+for i, v in enumerate(data['include']):
14
+ if 'packages' in data['include'][i]:
15
+ entries.append({
16
+ 'distro': data['include'][i]['distro'],
17
+ 'version': data['include'][i]['version'],
18
+ 'pkgclouddistro': data['include'][i]['packages']['repo_distro'],
19
+ 'format': data['include'][i]['packages']['type'],
20
+ 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'],
21
+ 'platform': data['platform_map']['amd64']
22
+ })
23
+
24
+entries.sort(key=lambda k: (k['distro'], k['version']))
25
+matrix = json.dumps({'include': entries}, sort_keys=True)
26
+print(matrix)
.github/scripts/get-static-cache-key.sh
+1
-1
@@ -12,4 +12,4 @@ docker run -it --rm --platform "${platform}" netdata/static-builder sh -c 'apk l
12
13
h="$(sha256sum /tmp/static-cache-key-data | cut -f 1 -d ' ')"
14
15
-echo "::set-output name=key::static-${arch}-${h}"
15
+echo "key=static-${arch}-${h}" >> "${GITHUB_OUTPUT}"
.github/scripts/prepare-release-base.sh
+31
-27
@@ -97,7 +97,7 @@ git config user.email "bot@netdata.cloud"
97
98
if [ "${REPO}" != "netdata/netdata" ] && [ -z "${RELEASE_TEST}" ]; then
99
echo "::notice::Not running in the netdata/netdata repository, not queueing a release build."
100
- echo "::set-output name=run::false"
100
+ echo "run=false" >> "${GITHUB_OUTPUT}"
101
elif [ "${EVENT_NAME}" = 'schedule' ] || [ "${EVENT_TYPE}" = 'nightly' ]; then
102
echo "::notice::Preparing a nightly release build."
103
LAST_TAG=$(git describe --abbrev=0 --tags)
@@ -107,15 +107,16 @@ elif [ "${EVENT_NAME}" = 'schedule' ] || [ "${EVENT_TYPE}" = 'nightly' ]; then
107
HEAD_COMMIT="$(git rev-parse HEAD)"
108
if [ "${EVENT_NAME}" = 'schedule' ] && [ "${LAST_VERSION_COMMIT}" = "${HEAD_COMMIT}" ] && grep -qE '.*-nightly$' packaging/version; then
109
echo "::notice::No commits since last nightly build, not publishing a new nightly build."
110
- echo "::set-output name=run::false"
110
+ echo "run=false" >> "${GITHUB_OUTPUT}"
111
else
112
echo "${NEW_VERSION}" > packaging/version || exit 1
113
- echo "::set-output name=run::true"
114
- echo "::set-output name=message::Update changelog and version for nightly build: ${NEW_VERSION}."
115
- echo "::set-output name=ref::master"
116
- echo "::set-output name=type::nightly"
117
- echo "::set-output name=branch::master"
118
- echo "::set-output name=version::nightly"
113
+ # shellcheck disable=SC2129
114
+ echo "run=true" >> "${GITHUB_OUTPUT}"
115
+ echo "message=Update changelog and version for nightly build: ${NEW_VERSION}." >> "${GITHUB_OUTPUT}"
116
+ echo "ref=master" >> "${GITHUB_OUTPUT}"
117
+ echo "type=nightly" >> "${GITHUB_OUTPUT}"
118
+ echo "branch=master" >> "${GITHUB_OUTPUT}"
119
+ echo "version=nightly" >> "${GITHUB_OUTPUT}"
120
fi
121
elif [ "${EVENT_TYPE}" = 'patch' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
122
echo "::notice::Preparing a patch release build."
@@ -130,12 +131,13 @@ elif [ "${EVENT_TYPE}" = 'patch' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
131
major_matches || exit 1
132
check_newer_patch_version || exit 1
133
echo "${EVENT_VERSION}" > packaging/version || exit 1
133
- echo "::set-output name=run::true"
134
- echo "::set-output name=message::Patch release ${EVENT_VERSION}."
135
- echo "::set-output name=ref::${EVENT_VERSION}"
136
- echo "::set-output name=type::release"
137
- echo "::set-output name=branch::${branch_name}"
138
- echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
134
+ # shellcheck disable=SC2129
135
+ echo "run=true" >> "${GITHUB_OUTPUT}"
136
+ echo "message=Patch release ${EVENT_VERSION}." >> "${GITHUB_OUTPUT}"
137
+ echo "ref=${EVENT_VERSION}" >> "${GITHUB_OUTPUT}"
138
+ echo "type=release" >> "${GITHUB_OUTPUT}"
139
+ echo "branch=${branch_name}" >> "${GITHUB_OUTPUT}"
140
+ echo "version=$(tr -d 'v' < packaging/version)" >> "${GITHUB_OUTPUT}"
141
elif [ "${EVENT_TYPE}" = 'minor' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
142
echo "::notice::Preparing a minor release build."
143
check_version_format || exit 1
@@ -149,13 +151,14 @@ elif [ "${EVENT_TYPE}" = 'minor' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
151
exit 1
152
fi
153
echo "${EVENT_VERSION}" > packaging/version || exit 1
152
- echo "::set-output name=run::true"
153
- echo "::set-output name=message::Minor release ${EVENT_VERSION}."
154
- echo "::set-output name=ref::${EVENT_VERSION}"
155
- echo "::set-output name=type::release"
156
- echo "::set-output name=branch::master"
157
- echo "::set-output name=new-branch::${branch_name}"
158
- echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
154
+ # shellcheck disable=SC2129
155
+ echo "run=true" >> "${GITHUB_OUTPUT}"
156
+ echo "message=Minor release ${EVENT_VERSION}." >> "${GITHUB_OUTPUT}"
157
+ echo "ref=${EVENT_VERSION}" >> "${GITHUB_OUTPUT}"
158
+ echo "type=release" >> "${GITHUB_OUTPUT}"
159
+ echo "branch=master" >> "${GITHUB_OUTPUT}"
160
+ echo "new-branch=${branch_name}" >> "${GITHUB_OUTPUT}"
161
+ echo "version=$(tr -d 'v' < packaging/version)" >> "${GITHUB_OUTPUT}"
162
elif [ "${EVENT_TYPE}" = 'major' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
163
echo "::notice::Preparing a major release build."
164
check_version_format || exit 1
@@ -164,12 +167,13 @@ elif [ "${EVENT_TYPE}" = 'major' ] && [ "${EVENT_VERSION}" != "nightly" ]; then
167
check_newer_major_version || exit 1
168
check_for_existing_tag || exit 1
169
echo "${EVENT_VERSION}" > packaging/version || exit 1
167
- echo "::set-output name=run::true"
168
- echo "::set-output name=message::Major release ${EVENT_VERSION}"
169
- echo "::set-output name=ref::${EVENT_VERSION}"
170
- echo "::set-output name=type::release"
171
- echo "::set-output name=branch::master"
172
- echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
170
+ # shellcheck disable=SC2129
171
+ echo "run=true" >> "${GITHUB_OUTPUT}"
172
+ echo "message=Major release ${EVENT_VERSION}" >> "${GITHUB_OUTPUT}"
173
+ echo "ref=${EVENT_VERSION}" >> "${GITHUB_OUTPUT}"
174
+ echo "type=release" >> "${GITHUB_OUTPUT}"
175
+ echo "branch=master" >> "${GITHUB_OUTPUT}"
176
+ echo "version=$(tr -d 'v' < packaging/version)" >> "${GITHUB_OUTPUT}"
177
else
178
echo '::error::Unrecognized release type or invalid version.'
179
exit 1
.github/workflows/build.yml
+8
-37
@@ -57,7 +57,7 @@ jobs:
57
--with-math \
58
--with-user=netdata
59
make dist
60
- echo "::set-output name=distfile::$(find . -name 'netdata-*.tar.gz')"
60
+ echo "distfile=$(find . -name 'netdata-*.tar.gz')" >> "${GITHUB_OUTPUT}"
61
cp netdata-*.tar.gz artifacts/
62
- name: Store
63
id: store
@@ -183,39 +183,10 @@ jobs:
183
sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml
184
- name: Read build matrix
185
id: set-matrix
186
- shell: python3 {0}
186
run: |
188
- from ruamel.yaml import YAML
189
- import json
190
- yaml = YAML(typ='safe')
191
- entries = list()
192
-
193
- with open('.github/data/distros.yml') as f:
194
- data = yaml.load(f)
195
-
196
- for i, v in enumerate(data['include']):
197
- e = {
198
- 'artifact_key': v['distro'] + str(v['version']).replace('.', ''),
199
- 'version': v['version'],
200
- }
201
-
202
- if 'base_image' in v:
203
- e['distro'] = ':'.join([v['base_image'], str(v['version'])])
204
- else:
205
- e['distro'] = ':'.join([v['distro'], str(v['version'])])
206
-
207
- if 'env_prep' in v:
208
- e['env_prep'] = v['env_prep']
209
-
210
- if 'jsonc_removal' in v:
211
- e['jsonc_removal'] = v['jsonc_removal']
212
-
213
- entries.append(e)
214
-
215
- entries.sort(key=lambda k: k['distro'])
216
- matrix = json.dumps({'include': entries}, sort_keys=True)
217
- print('Generated Matrix: ' + matrix)
218
- print('::set-output name=matrix::' + matrix)
187
+ matrix="$(.github/scripts/gen-matrix-build.py)"
188
+ echo "Generated matrix: ${matrix}"
189
+ echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
190
- name: Failure Notification
191
uses: rtCamp/action-slack-notify@v2
192
env:
@@ -363,7 +334,7 @@ jobs:
334
id: load
335
run: |
336
docker load --input image.tar | tee image-info.txt
366
- echo "::set-output name=image::$(cut -d ':' -f 3 image-info.txt)"
337
+ echo "image=$(cut -d ':' -f 3 image-info.txt)" >> "${GITHUB_OUTPUT}"
338
- name: Regular build on ${{ matrix.distro }}
339
id: build-basic
340
run: |
@@ -458,7 +429,7 @@ jobs:
429
id: load
430
run: |
431
docker load --input image.tar | tee image-info.txt
461
- echo "::set-output name=image::$(cut -d ':' -f 3 image-info.txt)"
432
+ echo "image=$(cut -d ':' -f 3 image-info.txt)" >> "${GITHUB_OUTPUT}"
433
- name: Install netdata and run the updater on ${{ matrix.distro }}
434
id: updater-check
435
run: |
@@ -790,9 +761,9 @@ jobs:
761
id: tag
762
run: |
763
if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then
793
- echo "::set-output name=tag::v${{ github.event.inputs.version }}"
764
+ echo "tag=v${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
765
else
795
- echo "::set-output name=tag::${{ github.event.inputs.version }}"
766
+ echo "tag=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
767
fi
768
769
upload-release: # Create the draft release and upload the build artifacts.
.github/workflows/cloud_regression.yml
+4
-4
@@ -33,10 +33,10 @@ jobs:
33
NETDATA_CUSTOM_PR_NUMBER=""
34
NETDATA_CUSTOM_COMMIT_HASH="${{ github.sha }}"
35
fi
36
- echo "netdata_repo=${NETDATA_CUSTOM_REPO}" >> $GITHUB_OUTPUT
37
- echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}" >> $GITHUB_OUTPUT
38
- echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}" >> $GITHUB_OUTPUT
39
- echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}" >> $GITHUB_OUTPUT
36
+ echo "netdata_repo=${NETDATA_CUSTOM_REPO}" >> $GITHUB_OUTPUT
37
+ echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}" >> $GITHUB_OUTPUT
38
+ echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}" >> $GITHUB_OUTPUT
39
+ echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}" >> $GITHUB_OUTPUT
40
41
- name: Trigger Full Cloud Regression
42
uses: aurelien-baudet/workflow-dispatch@v2
.github/workflows/codeql.yml
+9
-9
@@ -32,39 +32,39 @@ jobs:
32
run: |
33
if [ "${{ github.event_name }}" = "pull_request" ]; then
34
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/codeql') }}" = "true" ]; then
35
- echo '::set-output name=run::true'
35
+ echo "run=true" >> "${GITHUB_OUTPUT}"
36
echo '::notice::Found ci/codeql label, unconditionally running all CodeQL checks.'
37
else
38
- echo '::set-output name=run::false'
38
+ echo "run=false" >> "${GITHUB_OUTPUT}"
39
fi
40
else
41
- echo '::set-output name=run::true'
41
+ echo "run=true" >> "${GITHUB_OUTPUT}"
42
fi
43
- name: Check for C/C++ changes
44
id: cpp
45
run: |
46
if [ "${{ steps.always.outputs.run }}" = "false" ]; then
47
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*\.[ch](xx|\+\+)?' ; then
48
- echo '::set-output name=run::true'
48
+ echo "run=true" >> "${GITHUB_OUTPUT}"
49
echo '::notice::C/C++ code has changed, need to run CodeQL.'
50
else
51
- echo '::set-output name=run::false'
51
+ echo "run=false" >> "${GITHUB_OUTPUT}"
52
fi
53
else
54
- echo '::set-output name=run::true'
54
+ echo "run=true" >> "${GITHUB_OUTPUT}"
55
fi
56
- name: Check for python changes
57
id: python
58
run: |
59
if [ "${{ steps.always.outputs.run }}" = "false" ]; then
60
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq 'collectors/python.d.plugin/.*\.py' ; then
61
- echo '::set-output name=run::true'
61
+ echo "run=true" >> "${GITHUB_OUTPUT}"
62
echo '::notice::Python code has changed, need to run CodeQL.'
63
else
64
- echo '::set-output name=run::false'
64
+ echo "run=false" >> "${GITHUB_OUTPUT}"
65
fi
66
else
67
- echo '::set-output name=run::true'
67
+ echo "run=true" >> "${GITHUB_OUTPUT}"
68
fi
69
70
analyze-cpp:
.github/workflows/docker.yml
+2
-2
@@ -129,9 +129,9 @@ jobs:
129
id: tag
130
run: |
131
if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then
132
- echo "::set-output name=tag::v${{ github.event.inputs.version }}"
132
+ echo "tag=v${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
133
else
134
- echo "::set-output name=tag::${{ github.event.inputs.version }}"
134
+ echo "tag=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
135
fi
136
137
docker-publish:
.github/workflows/packaging.yml
+19
-45
@@ -44,41 +44,15 @@ jobs:
44
sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml
45
- name: Read build matrix
46
id: set-matrix
47
- shell: python3 {0}
47
run: |
49
- from ruamel.yaml import YAML
50
- import json
51
- import re
52
- import os
53
- ALWAYS_RUN_ARCHES = ["amd64", "x86_64"]
54
- yaml = YAML(typ='safe')
55
- entries = list()
56
- run_limited = False
57
-
58
- with open('.github/data/distros.yml') as f:
59
- data = yaml.load(f)
60
-
61
- if "${{ github.event_name }}" == "pull_request" and "${{ !contains(github.event.pull_request.labels.*.name, 'run-ci/packaging') }}":
62
- run_limited = True
63
-
64
- for i, v in enumerate(data['include']):
65
- if 'packages' in data['include'][i]:
66
- for arch in data['include'][i]['packages']['arches']:
67
- if arch in ALWAYS_RUN_ARCHES or not run_limited:
68
- entries.append({
69
- 'distro': data['include'][i]['distro'],
70
- 'version': data['include'][i]['version'],
71
- 'repo_distro': data['include'][i]['packages']['repo_distro'],
72
- 'format': data['include'][i]['packages']['type'],
73
- 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'],
74
- 'platform': data['platform_map'][arch],
75
- 'arch': arch
76
- })
77
-
78
- entries.sort(key=lambda k: (data['arch_order'].index(k['arch']), k['distro'], k['version']))
79
- matrix = json.dumps({'include': entries}, sort_keys=True)
80
- print('Generated Matrix: ' + matrix)
81
- print('::set-output name=matrix::' + matrix)
48
+ if [ "${{ github.event_name }}" = "pull_request" ] && \
49
+ [ "${{ !contains(github.event.pull_request.labels.*.name, 'run-ci/packaging') }}" = "true" ]; then
50
+ matrix="$(.github/scripts/gen-matrix-packaging.py 1)"
51
+ else
52
+ matrix="$(.github/scripts/gen-matrix-packaging.py 0)"
53
+ fi
54
+ echo "Generated matrix: ${matrix}"
55
+ echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
56
- name: Failure Notification
57
uses: rtCamp/action-slack-notify@v2
58
env:
@@ -117,24 +91,24 @@ jobs:
91
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
92
case "${{ github.event.inputs.type }}" in
93
"release")
120
- echo "::set-output name=repo::${REPO_PREFIX}"
121
- echo "::set-output name=version::${{ github.event.inputs.version }}"
122
- echo "::set-output name=retention::365"
94
+ echo "repo=${REPO_PREFIX}" >> "${GITHUB_OUTPUT}"
95
+ echo "version=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
96
+ echo "retention=365" >> "${GITHUB_OUTPUT}"
97
;;
98
"nightly")
125
- echo "::set-output name=repo::${REPO_PREFIX}-edge"
126
- echo "::set-output name=version::$(tr -d 'v' < packaging/version)"
127
- echo "::set-output name=retention::30"
99
+ echo "repo=${REPO_PREFIX}-edge" >> "${GITHUB_OUTPUT}"
100
+ echo "version=$(tr -d 'v' < packaging/version)" >> "${GITHUB_OUTPUT}"
101
+ echo "retention=30" >> "${GITHUB_OUTPUT}"
102
;;
103
*)
130
- echo "::set-output name=repo::${REPO_PREFIX}-devel"
131
- echo "::set-output name=version::0.${GITHUB_SHA}"
132
- echo "::set-output name=retention::30"
104
+ echo "repo=${REPO_PREFIX}-devel" >> "${GITHUB_OUTPUT}"
105
+ echo "version=0.${GITHUB_SHA}" >> "${GITHUB_OUTPUT}"
106
+ echo "retention=30" >> "${GITHUB_OUTPUT}"
107
;;
108
esac
109
else
136
- echo "::set-output name=version::$(cut -d'-' -f 1 packaging/version | tr -d 'v')"
137
- echo "::set-output name=retention::0"
110
+ echo "version=$(cut -d'-' -f 1 packaging/version | tr -d 'v')" >> "${GITHUB_OUTPUT}"
111
+ echo "retention=0" >> "${GITHUB_OUTPUT}"
112
fi
113
- name: Failure Notification
114
uses: rtCamp/action-slack-notify@v2
.github/workflows/repoconfig-packages.yml
+3
-24
@@ -34,31 +34,10 @@ jobs:
34
sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml
35
- name: Read build matrix
36
id: set-matrix
37
- shell: python3 {0}
37
run: |
39
- from ruamel.yaml import YAML
40
- import json
41
- yaml = YAML(typ='safe')
42
- entries = list()
43
-
44
- with open('.github/data/distros.yml') as f:
45
- data = yaml.load(f)
46
-
47
- for i, v in enumerate(data['include']):
48
- if 'packages' in data['include'][i]:
49
- entries.append({
50
- 'distro': data['include'][i]['distro'],
51
- 'version': data['include'][i]['version'],
52
- 'pkgclouddistro': data['include'][i]['packages']['repo_distro'],
53
- 'format': data['include'][i]['packages']['type'],
54
- 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'],
55
- 'platform': data['platform_map']['amd64']
56
- })
57
-
58
- entries.sort(key=lambda k: (k['distro'], k['version']))
59
- matrix = json.dumps({'include': entries}, sort_keys=True)
60
- print('Generated Matrix: ' + matrix)
61
- print('::set-output name=matrix::' + matrix)
38
+ matrix="$(.github/scripts/gen-matrix-repoconfig.py)"
39
+ echo "Generated matrix: ${matrix}"
40
+ echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
41
- name: Failure Notification
42
uses: rtCamp/action-slack-notify@v2
43
env:
.github/workflows/review.yml
+15
-15
@@ -29,56 +29,56 @@ jobs:
29
id: actionlint
30
run: |
31
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/actionlint') }}" = "true" ]; then
32
- echo '::set-output name=run::true'
32
+ echo "run=true" >> "${GITHUB_OUTPUT}"
33
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '\.github/workflows/.*' ; then
34
- echo '::set-output name=run::true'
34
+ echo "run=true" >> "${GITHUB_OUTPUT}"
35
echo 'GitHub Actions workflows have changed, need to run actionlint.'
36
else
37
- echo '::set-output name=run::false'
37
+ echo "run=false" >> "${GITHUB_OUTPUT}"
38
fi
39
- name: Check files for eslint
40
id: eslint
41
run: |
42
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/eslint') }}" = "true" ]; then
43
- echo '::set-output name=run::true'
43
+ echo "run=true" >> "${GITHUB_OUTPUT}"
44
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -v "web/gui/dashboard" | grep -Eq '.*\.js|node\.d\.plugin\.in' ; then
45
- echo '::set-output name=run::true'
45
+ echo "run=true" >> "${GITHUB_OUTPUT}"
46
echo 'JS files have changed, need to run ESLint.'
47
else
48
- echo '::set-output name=run::false'
48
+ echo "run=false" >> "${GITHUB_OUTPUT}"
49
fi
50
- name: Check files for hadolint
51
id: hadolint
52
run: |
53
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/hadolint') }}" = "true" ]; then
54
- echo '::set-output name=run::true'
54
+ echo "run=true" >> "${GITHUB_OUTPUT}"
55
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*Dockerfile.*' ; then
56
- echo '::set-output name=run::true'
56
+ echo "run=true" >> "${GITHUB_OUTPUT}"
57
echo 'Dockerfiles have changed, need to run Hadolint.'
58
else
59
- echo '::set-output name=run::false'
59
+ echo "run=false" >> "${GITHUB_OUTPUT}"
60
fi
61
- name: Check files for shellcheck
62
id: shellcheck
63
run: |
64
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/shellcheck') }}" = "true" ]; then
65
- echo '::set-output name=run::true'
65
+ echo "run=true" >> "${GITHUB_OUTPUT}"
66
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*\.sh.*' ; then
67
- echo '::set-output name=run::true'
67
+ echo "run=true" >> "${GITHUB_OUTPUT}"
68
echo 'Shell scripts have changed, need to run shellcheck.'
69
else
70
- echo '::set-output name=run::false'
70
+ echo "run=false" >> "${GITHUB_OUTPUT}"
71
fi
72
- name: Check files for yamllint
73
id: yamllint
74
run: |
75
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/yamllint') }}" = "true" ]; then
76
- echo '::set-output name=run::true'
76
+ echo "run=true" >> "${GITHUB_OUTPUT}"
77
elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '.*\.ya?ml|python\.d/.*\.conf' ; then
78
- echo '::set-output name=run::true'
78
+ echo "run=true" >> "${GITHUB_OUTPUT}"
79
echo 'YAML files have changed, need to run yamllint.'
80
else
81
- echo '::set-output name=run::false'
81
+ echo "run=false" >> "${GITHUB_OUTPUT}"
82
fi
83
84
actionlint: