@cryptotaxi247 / netdata-1 / commits / 90b2860fc

Fix action lints (#17120)

* Clang output should be disabled Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Commend out Clang Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Fix quoting and snooze sc2043 Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Fix failure messages garbages/steps Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Fix failure messages step, cleanup garbages Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Add quoting whever is necessary and group the echo commands Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Fix parorama Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * apply code review Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * micnor fix Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * more fixes Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> --------- Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

Tasos Katsoulas committed Mar 29, 2024 at 14:05 UTC 90b2860fcdb0d0ec0a2f9ea59725299323e7a948
7 files changed +58 -57
.github/workflows/build.yml
+1 -2
@@ -634,10 +634,9 @@ jobs:
634 SLACK_USERNAME: 'GitHub Actions'
635 SLACK_MESSAGE: |-
636 ${{ github.repository }}: Failed to prepare release artifacts for upload.
637 - CHeckout: ${{ steps.checkout.outcome }}
637 + Checkout: ${{ steps.checkout.outcome }}
638 Prepare environment: ${{ steps.prepare.outcome }}
639 Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
640 - Fetch static builds: ${{ steps.fetch-static.outcome }}
640 Consolidate artifacts: ${{ steps.consolidate.outcome }}
641 Store: ${{ steps.store.outcome }}
642 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
.github/workflows/cloud_regression.yml
+9 -6
@@ -22,21 +22,24 @@ jobs:
22 PR_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
23 id: output-workflow-dispatch-params
24 run: |
25 - if [ ${{ github.event_name }} == 'pull_request_target' ]; then
25 + if [ "${{ github.event_name }}" == 'pull_request_target' ]; then
26 NETDATA_CUSTOM_REPO="$PR_REPO_NAME"
27 NETDATA_CUSTOM_BRANCH="$PR_BRANCH_NAME"
28 NETDATA_CUSTOM_PR_NUMBER="${{ github.event.number }}"
29 NETDATA_CUSTOM_COMMIT_HASH="$PR_COMMIT_HASH"
30 - elif [ ${{ github.event_name }} == 'push' ]; then
30 + elif [ "${{ github.event_name }}" == 'push' ]; then
31 NETDATA_CUSTOM_REPO="netdata/netdata"
32 NETDATA_CUSTOM_BRANCH="master"
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 +
37 + {
38 + echo "netdata_repo=${NETDATA_CUSTOM_REPO}"
39 + echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}"
40 + echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}"
41 + echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}"
42 + } >> "$GITHUB_OUTPUT"
43
44 - name: Trigger Full Cloud Regression
45 uses: aurelien-baudet/workflow-dispatch@v2
.github/workflows/docker.yml
+3 -3
@@ -333,7 +333,7 @@ jobs:
333 - name: Create and Push Manifest
334 id: manifest
335 if: github.repository == 'netdata/netdata'
336 - run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests '' ${{ needs.gen-tags.outputs.tags }})
336 + run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests '' "${{ needs.gen-tags.outputs.tags }}")"
337 - name: Failure Notification
338 uses: rtCamp/action-slack-notify@v2
339 env:
@@ -489,7 +489,7 @@ jobs:
489 - name: Create and Push Manifest
490 id: manifest
491 if: github.repository == 'netdata/netdata'
492 - run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'quay.io' ${{ needs.gen-tags.outputs.tags }})
492 + run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'quay.io' "${{ needs.gen-tags.outputs.tags }}")"
493 - name: Failure Notification
494 uses: rtCamp/action-slack-notify@v2
495 env:
@@ -645,7 +645,7 @@ jobs:
645 - name: Create and Push Manifest
646 id: manifest
647 if: github.repository == 'netdata/netdata'
648 - run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'ghcr.io' ${{ needs.gen-tags.outputs.tags }})
648 + run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'ghcr.io' "${{ needs.gen-tags.outputs.tags }}")"
649 - name: Failure Notification
650 uses: rtCamp/action-slack-notify@v2
651 env:
.github/workflows/generate-integrations.yml
+1 -3
@@ -79,9 +79,7 @@ jobs:
79 SLACK_MESSAGE: |-
80 ${{ github.repository }}: Failed to create PR rebuilding integrations.js
81 Checkout Agent: ${{ steps.checkout-agent.outcome }}
82 - Get Go Ref: ${{ steps.get-go-ref.outcome }}
83 - Checkout Go: ${{ steps.checkout-go.outcome }}
84 - Prepare Dependencies: ${{ steps.prep-deps.outcome }}
82 + Prep python env and deps: ${{ steps.prep-deps.outcome }}
83 Generate Integrations: ${{ steps.generate.outcome }}
84 Generate Integrations Documentation: ${{ steps.generate-integrations-documentation.outcome }}
85 Generate src/collectors/COLLECTORS.md: ${{ steps.generate-collectors-md.outcome }}
.github/workflows/monitor-releases.yml
+1 -1
@@ -31,7 +31,7 @@ jobs:
31 run: |
32 if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
33 echo "RELEASE_CHANNEL=${{ github.event.inputs.channel }}" >> "${GITHUB_ENV}"
34 - else:
34 + else
35 echo "RELEASE_CHANNEL=stable" >> "${GITHUB_ENV}"
36 fi
37 - name: Init Python environment
.github/workflows/repoconfig-packages.yml
+7 -6
@@ -126,13 +126,14 @@ jobs:
126 id: package-upload
127 if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
128 run: |
129 - for arch in ${{ matrix.arches }}; do
130 - for suffix in '' -edge -repoconfig ; do
129 + # shellcheck disable=SC2043
130 + for arch in "${{ matrix.arches }}"; do
131 + for suffix in '' -edge -repoconfig; do
132 .github/scripts/package-upload.sh \
132 - ${{ matrix.pkgclouddistro }} \
133 - ${arch} \
134 - ${{ matrix.format }} \
135 - netdata/netdata${suffix}
133 + "${{ matrix.pkgclouddistro }}" \
134 + "${arch}" \
135 + "${{ matrix.format }}" \
136 + netdata/netdata"${suffix}"
137 done
138 done
139 - name: Failure Notification
.github/workflows/review.yml
+36 -36
@@ -15,7 +15,7 @@ jobs:
15 runs-on: ubuntu-latest
16 outputs:
17 actionlint: ${{ steps.actionlint.outputs.run }}
18 - clangformat: ${{ steps.clangformat.outputs.run }}
18 + # clangformat: ${{ steps.clangformat.outputs.run }}
19 flake8: ${{ steps.flake8.outputs.run }}
20 golangci-lint: ${{ steps.golangci-lint.outputs.run }}
21 hadolint: ${{ steps.hadolint.outputs.run }}
@@ -65,11 +65,11 @@ jobs:
65 run: |
66 if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/golangci-lint') }}" = "true" ]; then
67 echo "run=true" >> "${GITHUB_OUTPUT}"
68 - elif git diff --name-only origin/${{ github.base_ref }} HEAD -- | grep -Eq '.*\.go' ; then
69 - echo "run=true" >> $GITHUB_OUTPUT
68 + elif git diff --name-only origin/"${{ github.base_ref }}" HEAD -- | grep -Eq '.*\.go'; then
69 + echo "run=true" >> "${GITHUB_OUTPUT}"
70 echo 'Go code has changed, need to run golangci-lint.'
71 else
72 - echo "run=false" >> $GITHUB_OUTPUT
72 + echo "run=false" >> "${GITHUB_OUTPUT}"
73 fi
74 - name: Check files for hadolint
75 id: hadolint
@@ -122,38 +122,38 @@ jobs:
122 github_token: ${{ secrets.GITHUB_TOKEN }}
123 reporter: github-pr-check
124
125 - clang-format:
126 - name: clang-format
127 - needs: prep-review
128 - if: needs.prep-review.outputs.clangformat == 'true'
129 - runs-on: ubuntu-latest
130 - steps:
131 - - name: Git clone repository
132 - uses: actions/checkout@v4
133 - with:
134 - submodules: false
135 - fetch-depth: 0
136 - - name: Check for label
137 - id: label
138 - run: |
139 - if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
140 - echo 'check-all=true' >> "${GITHUB_OUTPUT}"
141 - else
142 - echo 'check-all=false' >> "${GITHUB_OUTPUT}"
143 - fi
144 - - name: Run clang-format
145 - run: |
146 - if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
147 - find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
148 - else
149 - git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
150 - xargs -n 1 -r clang-format -i --style=file
151 - fi
152 - git status --porcelain=v1 > /tmp/porcelain
153 - if [ -s /tmp/porcelain ]; then
154 - cat /tmp/porcelain
155 - exit 1
156 - fi
125 +# clang-format:
126 +# name: clang-format
127 +# needs: prep-review
128 +# if: needs.prep-review.outputs.clangformat == 'true'
129 +# runs-on: ubuntu-latest
130 +# steps:
131 +# - name: Git clone repository
132 +# uses: actions/checkout@v4
133 +# with:
134 +# submodules: false
135 +# fetch-depth: 0
136 +# - name: Check for label
137 +# id: label
138 +# run: |
139 +# if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
140 +# echo 'check-all=true' >> "${GITHUB_OUTPUT}"
141 +# else
142 +# echo 'check-all=false' >> "${GITHUB_OUTPUT}"
143 +# fi
144 +# - name: Run clang-format
145 +# run: |
146 +# if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
147 +# find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
148 +# else
149 +# git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
150 +# xargs -n 1 -r clang-format -i --style=file
151 +# fi
152 +# git status --porcelain=v1 > /tmp/porcelain
153 +# if [ -s /tmp/porcelain ]; then
154 +# cat /tmp/porcelain
155 +# exit 1
156 +# fi
157
158 flake8:
159 name: flake8