Repository navigation
feat(lint): add lint-include workflow that runs only the linters a caller enables #551
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
be96f4a
feat(lint): add reusable secret-scan workflow that runs only gitleaks
DevSecNinja efba4c4
feat(lint): replace secret-scan wrapper with a lint-gitleaks-only input
DevSecNinja 15f7f01
test(lint): only accept predecessor terms that are false for skipped …
DevSecNinja 9623a90
feat(lint): replace lint-gitleaks-only with a lint-only list
DevSecNinja 6d930d5
feat(lint): add lint-include workflow that runs only the linters a ca…
DevSecNinja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| # actionlint configuration: https://github.com/rhysd/actionlint/blob/main/docs/config.md | ||
| paths: | ||
| .github/workflows/lint-include.yml: | ||
| ignore: | ||
| # actionlint (1.7.12) predates GitHub's `$/` self-repository syntax for | ||
| # reusable workflow calls (July 2026). Drop this once it supports it | ||
| # (#552). | ||
| - 'reusable workflow call "\$/\.github/workflows/lint\.yml" at "uses" is not following the format' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| --- | ||
| name: Reusable — Lint (include mode) | ||
|
|
||
| # Include mode of the reusable Lint workflow: every linter is off unless the | ||
| # caller turns it on (`lint-gitleaks: true` runs gitleaks and nothing else). | ||
| # Linters added to lint.yml later stay off here until a caller enables them. | ||
| # lint.yml itself is the exclude mode: every linter on, `lint-<name>: false` | ||
| # turns one off. This file only redeclares lint.yml's inputs, with every | ||
| # `lint-<name>` linter defaulting to false, and passes them all through. | ||
| # tests/lint-include.py fails CI when an input of lint.yml is missing here, | ||
| # isn't passed through unchanged, or a linter doesn't default to false. | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| mise-version: | ||
| description: "mise version to install" | ||
| required: true | ||
| type: string | ||
| golangci-lint-version: | ||
| description: "golangci-lint version to install (required only when Go linting runs)" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| go-version-file: | ||
| description: "Path to the Go version file" | ||
| required: false | ||
| type: string | ||
| default: "go.mod" | ||
| lint-config-dir: | ||
| description: "Directory containing optional linter config files" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| lint-fail-on-error: | ||
| description: "Fail the workflow when a linter fails" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-dprint: | ||
| description: "Run dprint (Markdown formatting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-yamlfmt: | ||
| description: "Run yamlfmt (YAML formatting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-yamllint: | ||
| description: "Run yamllint (YAML linting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-actionlint: | ||
| description: "Run actionlint (GitHub Actions linting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-gitleaks: | ||
| description: "Run gitleaks (secret scanning)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-go: | ||
| description: "Run golangci-lint (Go linting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-shellcheck: | ||
| description: "Run shellcheck (shell linting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-shellcheck-exclude: | ||
| description: "Glob pattern for paths to exclude from shellcheck (passed to find -not -path)" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| lint-shfmt: | ||
| description: "Run shfmt (shell formatting)" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-shfmt-exclude: | ||
| description: "Glob pattern for paths to exclude from shfmt (passed to find -not -path)" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| lint-checkov: | ||
| description: "Run checkov (IaC security) — uploads SARIF" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-trivy: | ||
| description: "Run trivy fs (misconfig + secrets) — uploads SARIF" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-zizmor: | ||
| description: "Run zizmor (Actions security) — uploads SARIF" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| lint-config-drift: | ||
| description: "Check local config files match central DevSecNinja/.github repo" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| upload-sarif: | ||
| description: "Upload checkov/trivy/zizmor results to GitHub code scanning (requires GitHub Advanced Security). Set | ||
| false for private repos without GHAS to gate on exit codes with console output instead." | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| lint-job-mode: | ||
| description: "How linters are scheduled: auto (default), single or parallel. See lint.yml." | ||
| required: false | ||
| type: string | ||
| default: auto | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| # `$/` (self-repository syntax) resolves to this workflow's own repository | ||
| # at the commit that is running, so a caller pinning lint-include.yml@<sha> | ||
| # gets lint.yml from that same commit, and this repository's callers test | ||
| # local changes to both. `./` is workspace-relative, so it isn't | ||
| # guaranteed to resolve to this repository when another repository calls | ||
| # this workflow, and an `owner/repo/...@<sha>` pin would lag behind | ||
| # lint.yml. actionlint doesn't know `$/` yet: .github/actionlint.yaml | ||
| # ignores that one error (#552). | ||
| uses: $/.github/workflows/lint.yml | ||
| permissions: | ||
| contents: read | ||
| # checkov, trivy, zizmor and gitleaks history findings go to code scanning. | ||
| security-events: write | ||
| with: | ||
| mise-version: ${{ inputs.mise-version }} | ||
| golangci-lint-version: ${{ inputs.golangci-lint-version }} | ||
| go-version-file: ${{ inputs.go-version-file }} | ||
| lint-config-dir: ${{ inputs.lint-config-dir }} | ||
| lint-fail-on-error: ${{ inputs.lint-fail-on-error }} | ||
| lint-dprint: ${{ inputs.lint-dprint }} | ||
| lint-yamlfmt: ${{ inputs.lint-yamlfmt }} | ||
| lint-yamllint: ${{ inputs.lint-yamllint }} | ||
| lint-actionlint: ${{ inputs.lint-actionlint }} | ||
| lint-gitleaks: ${{ inputs.lint-gitleaks }} | ||
| lint-go: ${{ inputs.lint-go }} | ||
| lint-shellcheck: ${{ inputs.lint-shellcheck }} | ||
| lint-shellcheck-exclude: ${{ inputs.lint-shellcheck-exclude }} | ||
| lint-shfmt: ${{ inputs.lint-shfmt }} | ||
| lint-shfmt-exclude: ${{ inputs.lint-shfmt-exclude }} | ||
| lint-checkov: ${{ inputs.lint-checkov }} | ||
| lint-trivy: ${{ inputs.lint-trivy }} | ||
| lint-zizmor: ${{ inputs.lint-zizmor }} | ||
| lint-config-drift: ${{ inputs.lint-config-drift }} | ||
| upload-sarif: ${{ inputs.upload-sarif }} | ||
| lint-job-mode: ${{ inputs.lint-job-mode }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.