From 87b75d29f31c0c802b6c7637f808d82478563933 Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:03:01 +0100 Subject: [PATCH 1/3] ci: add lint and secret-scan caller workflows Add the standard DevSecNinja lint caller and the secret-scan caller from repo-steward's workflow-templates (DevSecNinja/repo-steward#45 and DevSecNinja/repo-steward#140), both on DevSecNinja/.github v4.1.0: - .github/workflows/lint.yml: dprint, yamlfmt, yamllint, actionlint, gitleaks (the PR's own commits), shellcheck, shfmt, checkov, trivy and zizmor on pull requests and pushes to main; trivy, zizmor and checkov upload SARIF to code scanning. Linters only report (lint-fail-on-error is off). - .github/workflows/secret-scan.yml: gitleaks over the full history on push to main, weekly and on demand; findings go to code scanning (category gitleaks/history), the log shows a count only. The linters run from the repo's .mise.toml. --- .github/workflows/lint.yml | 43 ++++++++++++++++++++++++ .github/workflows/secret-scan.yml | 54 +++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/secret-scan.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..47b8491 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,43 @@ +--- +# Lint caller that repo-steward adds to public repos without one (rule +# baseline/required-file#lint, policy/baseline.toml [[files]]). It follows +# DevSecNinja/.github workflow-templates/lint.yml and +# docs/workflow-trigger-conventions.md. Private repos get lint-private.yml. +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Lint + +on: + # gitleaks scans only the PR's own commits here. The full history is + # scanned by secret-scan.yml (DevSecNinja/.github#520); this workflow's + # push run scans it too, as the reusable workflow does on every non-PR event. + pull_request: + # Public repos upload SARIF to code scanning, which needs a default-branch + # analysis as the baseline for PR alerts. + push: + branches: + - main + +permissions: + contents: read + +# One run per PR (or branch). A newer push to a PR cancels its running run; a +# running push run is never cancelled, a queued one is superseded. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + lint: + uses: DevSecNinja/.github/.github/workflows/lint.yml@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0 + permissions: + contents: read + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # The linters run from the repo's own mise config (.mise.toml): pin the + # tools it needs there. Every linter is on by default; turning off + # gitleaks, trivy, zizmor or checkov needs a repo-steward exception + # (rule security/ci-scanners). See DevSecNinja/.github + # workflow-templates/lint.yml for the other inputs. diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 0000000..5eb659b --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -0,0 +1,54 @@ +--- +# Secret-scan caller that repo-steward adds to every repo without one (rule +# baseline/required-file#secret-scan, policy/baseline.toml [[files]]). It +# follows DevSecNinja/.github's own secret-scan-caller.yml: the reusable lint +# workflow with only gitleaks on, which scans the full git history on every +# event that isn't a pull request (DevSecNinja/.github#520), so new gitleaks +# rules re-check old commits. Findings stay private: public repos upload them +# to code scanning (category gitleaks/history) and log a count only; private +# repos list them in the job summary, which only collaborators can read. +# Pull requests are scanned by the lint caller (their own commits only). +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Secret scan + +on: + push: + branches: + - main + schedule: + - cron: "23 5 * * 1" + workflow_dispatch: + +permissions: + contents: read + +# A scan that already started finishes; the next one queues. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + gitleaks: + uses: DevSecNinja/.github/.github/workflows/lint.yml@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0 + permissions: + contents: read + # Public repos: the history findings go to code scanning. + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # History findings only report (warnings); this fails the run when the + # scan or the code scanning upload fails, so a silent gap can't look + # green. gitleaks must be pinned in the repo's .mise.toml. + lint-fail-on-error: true + lint-dprint: false + lint-yamlfmt: false + lint-yamllint: false + lint-actionlint: false + lint-go: false + lint-shellcheck: false + lint-shfmt: false + lint-checkov: false + lint-trivy: false + lint-zizmor: false From b844fb0105acb415f7910099d4d7cd141690e162 Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:37:48 +0100 Subject: [PATCH 2/3] style: adopt the central lint configs and pin .github v4.2.1 Adopt the central lint configs from DevSecNinja/.github config-sync/files at v4.2.0, unchanged, as config-sync would deliver them: dprint.json and .editorconfig replace the local copies, .yamlfmt.yaml replaces .yamlfmt, and .yamllint.yaml is new. The central configs exclude release-please's CHANGELOG.md and Spec Kit output, so no source file changes. Also pin both callers to DevSecNinja/.github v4.2.1 (history findings file as High severity). --- .editorconfig | 21 ++++++++------ .github/workflows/lint.yml | 2 +- .github/workflows/secret-scan.yml | 2 +- .yamlfmt | 8 ------ .yamlfmt.yaml | 26 +++++++++++++++++ .yamllint.yaml | 22 +++++++++++++++ dprint.json | 46 ++++++++++++++----------------- 7 files changed, 82 insertions(+), 45 deletions(-) delete mode 100644 .yamlfmt create mode 100644 .yamlfmt.yaml create mode 100644 .yamllint.yaml diff --git a/.editorconfig b/.editorconfig index 4a2721c..245f5b7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,18 +1,21 @@ +; https://editorconfig.org/ + root = true [*] -charset = utf-8 +indent_style = space +indent_size = 2 end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true insert_final_newline = true -[*.{json,yml,yaml}] -indent_style = space -indent_size = 2 +[*.md] +indent_size = 4 +trim_trailing_whitespace = false -[*.{js,mjs,ts,tsx}] -indent_style = space -indent_size = 2 +[*.sh] +indent_size = 4 -[*.md] -indent_style = space +[*.py] indent_size = 4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 47b8491..ae4559a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ concurrency: jobs: lint: - uses: DevSecNinja/.github/.github/workflows/lint.yml@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0 + uses: DevSecNinja/.github/.github/workflows/lint.yml@ee84519c9f7faa34b318991a124f0f2faea274f4 # v4.2.1 permissions: contents: read security-events: write diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml index 5eb659b..2d46333 100644 --- a/.github/workflows/secret-scan.yml +++ b/.github/workflows/secret-scan.yml @@ -30,7 +30,7 @@ concurrency: jobs: gitleaks: - uses: DevSecNinja/.github/.github/workflows/lint.yml@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0 + uses: DevSecNinja/.github/.github/workflows/lint.yml@ee84519c9f7faa34b318991a124f0f2faea274f4 # v4.2.1 permissions: contents: read # Public repos: the history findings go to code scanning. diff --git a/.yamlfmt b/.yamlfmt deleted file mode 100644 index d992ee4..0000000 --- a/.yamlfmt +++ /dev/null @@ -1,8 +0,0 @@ ---- -line_ending: lf -formatter: - type: basic - include_document_start: true - retain_line_breaks_single: true - trim_trailing_whitespace: true - eof_newline: true diff --git a/.yamlfmt.yaml b/.yamlfmt.yaml new file mode 100644 index 0000000..ce24c16 --- /dev/null +++ b/.yamlfmt.yaml @@ -0,0 +1,26 @@ +--- +doublestar: true +formatter: + type: basic + disable_alias_key_correction: true + indent: 2 + max_line_length: 120 + pad_line_comments: 1 + drop_merge_tag: true + eof_newline: true + force_array_style: block + include_document_start: true + line_ending: lf + retain_line_breaks_single: true + scan_folded_as_literal: true + trim_trailing_whitespace: true +# APM-managed / generated files use the tool's own formatting — never hand-edited. +exclude: + - apm.yml + - apm.lock.yaml + - apm_modules/** + # Spec Kit output and Python virtual environments. Listed explicitly rather + # than through gitignore_excludes: without a .gitignore, yamlfmt then lints + # nothing and still exits 0. + - .specify/** + - .venv*/** diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..6e6f5ff --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,22 @@ +--- +extends: default + +rules: + # Inline comment spacing varies by author style — not auto-fixable + comments: disable + # Long lines are unavoidable with image digests, Traefik labels, and URLs — not auto-fixable + line-length: disable + # Let yamlfmt handle document start markers + document-start: disable + # Allow 'on:' as a mapping key in GitHub Actions workflows + truthy: + allowed-values: + - "true" + - "false" + check-keys: false + +# APM-managed / generated files use the tool's own formatting — never hand-edited. +ignore: |- + apm.yml + apm.lock.yaml + apm_modules/ diff --git a/dprint.json b/dprint.json index 675505a..f5e8c80 100644 --- a/dprint.json +++ b/dprint.json @@ -1,32 +1,26 @@ { - "json": { - "indentWidth": 2 - }, - "markdown": { - "lineWidth": 100, - "textWrap": "always" - }, - "typescript": { - "lineWidth": 100, - "quoteStyle": "alwaysSingle", - "semiColons": "always" - }, - "includes": [ - "**/*.{css,html,json,jsonc,md,ts,tsx}" - ], + "$schema": "https://dprint.dev/schemas/v0.json", + "includes": ["**/*.md"], "excludes": [ - "node_modules", - "dist", - "coverage", - ".vscode", - "src/data/generated", - "public/data/generated" + "**/node_modules", + "**/CHANGELOG.md", + "**/release-notes.md", + "apm_modules/**", + ".github/prompts/**", + ".github/instructions/**", + ".github/agents/**", + ".github/chatmodes/**", + ".claude/**", + ".cursor/**", + ".opencode/**", + ".gemini/**", + ".windsurf/**", + ".kiro/**", + ".agents/**", + ".github/skills/**", + ".specify/**" ], "plugins": [ - "https://plugins.dprint.dev/json-0.23.0.wasm", - "https://plugins.dprint.dev/markdown-0.23.3.wasm", - "https://plugins.dprint.dev/typescript-0.96.1.wasm", - "https://plugins.dprint.dev/g-plane/malva-v0.16.0.wasm", - "https://plugins.dprint.dev/g-plane/markup_fmt-v0.27.3.wasm" + "https://plugins.dprint.dev/markdown-0.21.1.wasm" ] } From 013099ab6079d3801133460739965b0950aaf20e Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Tue, 17 Nov 2026 11:29:00 +0100 Subject: [PATCH 3/3] ci: move the lint callers to .github v4.4.0 and lint-include.yml Move both callers to DevSecNinja/.github v4.4.0. The secret-scan caller now calls the thin lint-include.yml, where every linter is off unless set to true, with only lint-gitleaks: true. It replaces the list of lint-*: false inputs, which linters added to lint.yml later would slip past. mise-version and lint-fail-on-error are unchanged. The lint caller keeps lint.yml (same inputs and job names). The secret-scan jobs are now named gitleaks / lint / gitleaks, because lint-include.yml calls lint.yml through the self-repository ($/) syntax. --- .github/workflows/lint.yml | 2 +- .github/workflows/secret-scan.yml | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ae4559a..bb6e049 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ concurrency: jobs: lint: - uses: DevSecNinja/.github/.github/workflows/lint.yml@ee84519c9f7faa34b318991a124f0f2faea274f4 # v4.2.1 + uses: DevSecNinja/.github/.github/workflows/lint.yml@c93b7670605e165cc757724b690deb130784e803 # v4.4.0 permissions: contents: read security-events: write diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml index 2d46333..33572e3 100644 --- a/.github/workflows/secret-scan.yml +++ b/.github/workflows/secret-scan.yml @@ -1,9 +1,11 @@ --- # Secret-scan caller that repo-steward adds to every repo without one (rule # baseline/required-file#secret-scan, policy/baseline.toml [[files]]). It -# follows DevSecNinja/.github's own secret-scan-caller.yml: the reusable lint -# workflow with only gitleaks on, which scans the full git history on every -# event that isn't a pull request (DevSecNinja/.github#520), so new gitleaks +# follows DevSecNinja/.github's own secret-scan-caller.yml: lint-include.yml, +# the thin variant of the reusable lint workflow where every linter is off +# unless set to true, with only gitleaks on. gitleaks scans the full git +# history on every event that isn't a pull request (DevSecNinja/.github#520), +# so new gitleaks # rules re-check old commits. Findings stay private: public repos upload them # to code scanning (category gitleaks/history) and log a count only; private # repos list them in the job summary, which only collaborators can read. @@ -30,7 +32,7 @@ concurrency: jobs: gitleaks: - uses: DevSecNinja/.github/.github/workflows/lint.yml@ee84519c9f7faa34b318991a124f0f2faea274f4 # v4.2.1 + uses: DevSecNinja/.github/.github/workflows/lint-include.yml@c93b7670605e165cc757724b690deb130784e803 # v4.4.0 permissions: contents: read # Public repos: the history findings go to code scanning. @@ -42,13 +44,5 @@ jobs: # scan or the code scanning upload fails, so a silent gap can't look # green. gitleaks must be pinned in the repo's .mise.toml. lint-fail-on-error: true - lint-dprint: false - lint-yamlfmt: false - lint-yamllint: false - lint-actionlint: false - lint-go: false - lint-shellcheck: false - lint-shfmt: false - lint-checkov: false - lint-trivy: false - lint-zizmor: false + # lint-include.yml runs no linter unless it is set to true. + lint-gitleaks: true