From 0d4272310eeead79d81a1797b323d467d14cb05b Mon Sep 17 00:00:00 2001 From: Kaniska Date: Tue, 17 Feb 2026 10:20:42 +0000 Subject: [PATCH 1/8] Add linters in images repository --- .github/linters/.hadolint.yaml | 16 +++++++++ .github/linters/.shellcheckrc | 3 ++ .github/linters/eslint.config.mjs | 55 +++++++++++++++++++++++++++++++ .github/workflows/code-linter.yml | 31 +++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 .github/linters/.hadolint.yaml create mode 100644 .github/linters/.shellcheckrc create mode 100644 .github/linters/eslint.config.mjs create mode 100644 .github/workflows/code-linter.yml diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml new file mode 100644 index 0000000000..61529f97ab --- /dev/null +++ b/.github/linters/.hadolint.yaml @@ -0,0 +1,16 @@ +--- +########################## +## Hadolint config file ## +########################## +failure-threshold: "error" +ignored: + - DL4001 # Ignore wget and curl in same file + - DL4006 # ignore pipefail as we don't want to add layers + - DL3018 # We do pin version in pipfile.lock + - DL3013 # We do pin version in pipfile.lock + - DL3003 # Ignore workdir so we don't add layers + - SC2016 # ignore as its interpreted later + - DL3044 # Ignore using env in env + - DL3008 # Ignore pinned versions check for APT + - SC3020 # Ignore POSIX check of the shorthand redirection(&>) + - SC2283 # Remove spaces around = to assign and this is not needed diff --git a/.github/linters/.shellcheckrc b/.github/linters/.shellcheckrc new file mode 100644 index 0000000000..05da7bf6f6 --- /dev/null +++ b/.github/linters/.shellcheckrc @@ -0,0 +1,3 @@ +shell=bash +disable=SC1101,SC1102 +severity=error diff --git a/.github/linters/eslint.config.mjs b/.github/linters/eslint.config.mjs new file mode 100644 index 0000000000..f89d7ada71 --- /dev/null +++ b/.github/linters/eslint.config.mjs @@ -0,0 +1,55 @@ +import { defineConfig } from "eslint/config"; +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import globals from "globals"; +import jsoncParser from "jsonc-eslint-parser"; + +const compat = new FlatCompat(); + +export default defineConfig([ + js.configs.recommended, + + { + files: ["**/*.js", "**/*.cjs"], + languageOptions: { + ecmaVersion: 2021, + sourceType: "script", + globals: { + ...globals.node, + }, + }, + rules: { + "no-undef": "error", + }, + }, + + { + files: ["build/src/prep.js"], + languageOptions: { + globals: { scriptLibraryPathInRepo: "readonly" }, + }, + }, + + { + files: ["build/src/push.js"], + rules: { + "no-useless-escape": "off", + }, + }, + + { + files: ["build/src/utils/async.js"], + rules: { + "no-redeclare": ["error", { builtinGlobals: false }], + }, + }, + + ...compat.extends("plugin:jsonc/recommended-with-jsonc"), + { + files: ["**/*.json"], + languageOptions: { + parser: jsoncParser, + parserOptions: { jsonSyntax: "JSONC" }, + }, + }, +]); diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml new file mode 100644 index 0000000000..7c91840bc9 --- /dev/null +++ b/.github/workflows/code-linter.yml @@ -0,0 +1,31 @@ +name: JSON and Dockerfile linter + +on: + push: + branches: + - main + pull_request: + +jobs: + code-linter-steps: + name: Json and Dockerfile linter + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: super-linter/super-linter/slim@v8 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BASH_SEVERITY: error + VALIDATE_ALL_CODEBASE: true + DEFAULT_BRANCH: main + FILTER_REGEX_INCLUDE: '(^|.*/)(src/.*|build/.*\.js|Dockerfile)$' + FILTER_REGEX_EXCLUDE: '(^|.*/)src/.*/test-project(/.*)?$' + VALIDATE_DOCKERFILE_HADOLINT: true + VALIDATE_JAVASCRIPT_ES: true + VALIDATE_JSON: true + VALIDATE_BASH: true + From 6915e6c070ceb0a2aac0dd88edb577110f659aeb Mon Sep 17 00:00:00 2001 From: Kaniska Date: Tue, 17 Feb 2026 16:58:29 +0530 Subject: [PATCH 2/8] Update .github/workflows/code-linter.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/code-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index 7c91840bc9..675187b0b8 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -8,7 +8,7 @@ on: jobs: code-linter-steps: - name: Json and Dockerfile linter + name: JSON and Dockerfile linter runs-on: ubuntu-latest steps: From c56d35b9c9079984a3526d73c867e6743eefa6e8 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Tue, 17 Feb 2026 16:59:34 +0530 Subject: [PATCH 3/8] Update .github/linters/.hadolint.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/linters/.hadolint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml index 61529f97ab..08e1f05154 100644 --- a/.github/linters/.hadolint.yaml +++ b/.github/linters/.hadolint.yaml @@ -6,8 +6,8 @@ failure-threshold: "error" ignored: - DL4001 # Ignore wget and curl in same file - DL4006 # ignore pipefail as we don't want to add layers - - DL3018 # We do pin version in pipfile.lock - - DL3013 # We do pin version in pipfile.lock + - DL3018 # Allow unpinned OS package versions (see DL3008 note for APT) + - DL3013 # Allow unpinned pip package versions; versions are managed outside the Dockerfile - DL3003 # Ignore workdir so we don't add layers - SC2016 # ignore as its interpreted later - DL3044 # Ignore using env in env From c2caadabcfd1cb64d58b7cdf8218c96dc55233bc Mon Sep 17 00:00:00 2001 From: Kaniska Date: Wed, 18 Feb 2026 10:27:44 +0000 Subject: [PATCH 4/8] Remove unused variable --- build/src/prep.js | 1 - 1 file changed, 1 deletion(-) diff --git a/build/src/prep.js b/build/src/prep.js index 713ef20d03..ae266693f0 100644 --- a/build/src/prep.js +++ b/build/src/prep.js @@ -7,7 +7,6 @@ const path = require('path'); const asyncUtils = require('./utils/async'); const configUtils = require('./utils/config'); const handlebars = require('handlebars'); -const mkdirp = require('mkdirp'); const scriptSHA = {}; const assetsPath = path.join(__dirname, '..', 'assets'); From dc1f82ed5af9ec74a3f23f188481b973bc2290ed Mon Sep 17 00:00:00 2001 From: Kaniska Date: Wed, 18 Feb 2026 15:55:25 +0000 Subject: [PATCH 5/8] Updating the GitHub Token to the expected PAT in images repo --- .github/workflows/code-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index 675187b0b8..0fb726f3c3 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -18,7 +18,7 @@ jobs: - uses: super-linter/super-linter/slim@v8 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }} BASH_SEVERITY: error VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: main From 3789d8553ba7ddbd229cd269ff0fa2e853952c4c Mon Sep 17 00:00:00 2001 From: Kaniska Date: Wed, 18 Feb 2026 16:19:12 +0000 Subject: [PATCH 6/8] Setting pull request summary flag to diable summary on the PR --- .github/workflows/code-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index 0fb726f3c3..cb1efe39b3 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -19,6 +19,7 @@ jobs: - uses: super-linter/super-linter/slim@v8 env: GITHUB_TOKEN: ${{ secrets.PAT }} + ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: false BASH_SEVERITY: error VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: main From 5d10c049670ffc63c7aaa7ee869e721664730b1f Mon Sep 17 00:00:00 2001 From: Kaniska Date: Wed, 18 Feb 2026 16:26:23 +0000 Subject: [PATCH 7/8] Setting MULTI_STATUS as false --- .github/workflows/code-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index cb1efe39b3..0e8d068111 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -18,7 +18,7 @@ jobs: - uses: super-linter/super-linter/slim@v8 env: - GITHUB_TOKEN: ${{ secrets.PAT }} + MULTI_STATUS : false ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: false BASH_SEVERITY: error VALIDATE_ALL_CODEBASE: true From 798b5a71f519f7541dc0060151054f95115aec28 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Wed, 18 Feb 2026 16:54:28 +0000 Subject: [PATCH 8/8] Changed the workflow and job name. --- .github/workflows/code-linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index 0e8d068111..97eafa60bc 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -1,4 +1,4 @@ -name: JSON and Dockerfile linter +name: JSON, shell, javascript and Dockerfile linter on: push: @@ -8,7 +8,7 @@ on: jobs: code-linter-steps: - name: JSON and Dockerfile linter + name: JSON, shell, javascript and Dockerfile linter runs-on: ubuntu-latest steps: