Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce github action linting in pre-commit #1065

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Introduce github action linting in pre-commit #1065

merged 1 commit into from
Feb 5, 2025

Conversation

kwk
Copy link
Collaborator

@kwk kwk commented Feb 5, 2025

This checks github action files in pre-commit. To run this locally, make sure you have shellcheck installed.

actionlint found these kind of problems and this PR addresses them ($ actionlint -oneline).

  1. Use $(...) notation instead of legacy backticks `...`
  2. Double quote to prevent globbing and word splitting
  3. Don't use variables in the printf format string. Use printf '..%s..' "$foo"
  4. Use -n instead of ! -z
  5. Consider using { cmd1; cmd2; } >> file instead of individual redirects
  6. "github.event.comment.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details
  7. This expression is constant. Did you forget a $ somewhere? - I have ignored that one because I think it was a false report. Wasn't it?

Here's a detailed list of all the problems that actionlint found:

.github/workflows/build-reproducer-container.yml:22:9: shellcheck reported issue in this script: SC2086:info:3:25: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/build-reproducer-container.yml:22:9: shellcheck reported issue in this script: SC2086:info:4:40: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/build-reproducer-container.yml:22:9: shellcheck reported issue in this script: SC2086:info:5:21: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/check-snapshots.yml:61:9: shellcheck reported issue in this script: SC2059:info:2:8: Don't use variables in the printf format string. Use printf '..%s..' "$foo" [shellcheck]
.github/workflows/check-snapshots.yml:83:9: shellcheck reported issue in this script: SC2236:style:3:7: Use -n instead of ! -z [shellcheck]
.github/workflows/check-snapshots.yml:83:9: shellcheck reported issue in this script: SC2006:style:10:12: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/check-snapshots.yml:83:9: shellcheck reported issue in this script: SC2086:info:14:17: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/check-snapshots.yml:83:9: shellcheck reported issue in this script: SC2086:info:16:9: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/check-snapshots.yml:83:9: shellcheck reported issue in this script: SC2086:info:23:14: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:49:9: shellcheck reported issue in this script: SC2059:info:2:8: Don't use variables in the printf format string. Use printf '..%s..' "$foo" [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2006:style:4:7: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2006:style:5:11: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2006:style:7:11: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2006:style:8:10: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2129:style:11:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:11:30: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:12:30: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:13:28: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:14:36: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:15:112: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:16:120: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:61:9: shellcheck reported issue in this script: SC2086:info:17:60: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2006:style:5:27: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2129:style:12:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2006:style:12:29: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2086:info:12:75: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2086:info:13:64: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2006:style:14:29: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:82:9: shellcheck reported issue in this script: SC2086:info:14:76: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:101:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:101:9: shellcheck reported issue in this script: SC2006:style:5:17: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:101:9: shellcheck reported issue in this script: SC2086:info:7:15: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:101:9: shellcheck reported issue in this script: SC2086:info:12:20: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:119:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:127:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:127:9: shellcheck reported issue in this script: SC2006:style:4:13: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:127:9: shellcheck reported issue in this script: SC2006:style:7:19: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:127:9: shellcheck reported issue in this script: SC2006:style:8:19: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:127:9: shellcheck reported issue in this script: SC2086:info:16:3: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:147:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:163:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:163:9: shellcheck reported issue in this script: SC2006:style:5:13: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/fedora-copr-build.yml:163:9: shellcheck reported issue in this script: SC2086:info:7:17: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:181:9: shellcheck reported issue in this script: SC2236:style:2:4: Use -n instead of ! -z [shellcheck]
.github/workflows/fedora-copr-build.yml:181:9: shellcheck reported issue in this script: SC2086:info:14:21: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/fedora-copr-build.yml:181:9: shellcheck reported issue in this script: SC2006:style:19:40: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:52:9: shellcheck reported issue in this script: SC2086:info:3:29: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:52:9: shellcheck reported issue in this script: SC2086:info:12:6: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:52:9: shellcheck reported issue in this script: SC2086:info:12:24: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:52:9: shellcheck reported issue in this script: SC2086:info:13:29: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:52:9: shellcheck reported issue in this script: SC2086:info:15:28: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-reporter.yml:73:9: shellcheck reported issue in this script: SC2086:info:2:42: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/mass-rebuild-runner.yml:30:9: shellcheck reported issue in this script: SC2059:info:2:8: Don't use variables in the printf format string. Use printf '..%s..' "$foo" [shellcheck]
.github/workflows/retest.yml:71:24: "github.event.comment.body" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details [expression]
.github/workflows/retest.yml:82:9: shellcheck reported issue in this script: SC2086:info:2:17: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2006:style:12:15: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:20:38: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:26:28: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2006:style:32:23: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:34:48: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:35:58: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2006:style:37:20: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:37:38: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2006:style:38:25: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/sync-on-llvm-version.yml:62:9: shellcheck reported issue in this script: SC2086:info:38:48: Double quote to prevent globbing and word splitting [shellcheck]
.github/workflows/update-build-time-diagrams.yml:37:9: shellcheck reported issue in this script: SC2059:info:2:8: Don't use variables in the printf format string. Use printf '..%s..' "$foo" [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2046:warning:2:79: Quote this to prevent word splitting [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2006:style:2:79: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2046:warning:3:79: Quote this to prevent word splitting [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2006:style:3:79: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2046:warning:4:73: Quote this to prevent word splitting [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2006:style:4:73: Use $(...) notation instead of legacy backticks `...` [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2078:error:13:7: This expression is constant. Did you forget a $ somewhere? [shellcheck]
.github/workflows/update-build-time-diagrams.yml:65:9: shellcheck reported issue in this script: SC2078:error:13:31: This expression is constant. Did you forget a $ somewhere? [shellcheck]

@kwk kwk requested a review from nikic February 5, 2025 09:22
Copy link
Collaborator

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kwk kwk merged commit 68b3e36 into main Feb 5, 2025
9 checks passed
@kwk kwk deleted the actionlinting branch February 5, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants