diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ad8206c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,47 @@ +--- +# 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@c93b7670605e165cc757724b690deb130784e803 # v4.4.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. + # Spec Kit output (vendored scripts) is not linted, as the central dprint + # and yamlfmt configs exclude .specify/**. The linters stay on for the rest. + lint-shellcheck-exclude: ".specify/*" + lint-shfmt-exclude: ".specify/*" diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 0000000..33572e3 --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -0,0 +1,48 @@ +--- +# 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: 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. +# 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-include.yml@c93b7670605e165cc757724b690deb130784e803 # v4.4.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-include.yml runs no linter unless it is set to true. + lint-gitleaks: true diff --git a/.mise.toml b/.mise.toml index 174736c..3b1769a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -13,6 +13,16 @@ python = "3.15.1" "pipx:ansible" = "14.5.0" "pipx:ansible-lint" = "26.10.1" "pipx:yamllint" = "1.38.0" +# Lint tools run by .github/workflows/lint.yml (Renovate keeps them current). +dprint = "0.64.3" +yamlfmt = "0.21.0" +actionlint = "1.7.12" +gitleaks = "8.30.1" +shellcheck = "0.11.0" +shfmt = "3.14.1" +trivy = "0.76.1" +zizmor = "1.31.1" +"pipx:checkov" = "3.4.0" # Bats testing framework bats = "1.14.0"