Repository navigation
ci: add the standard lint and secret-scan CI #194
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
Open
DevSecNinja
wants to merge
3
commits into
main
Choose a base branch
from
steward/lint-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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@231c380d4f75486e159ed2e3d806bc76ff193a43 # v4.7.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/*" | ||
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,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 | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| jobs: | ||
| gitleaks: | ||
| uses: DevSecNinja/.github/.github/workflows/lint-include.yml@231c380d4f75486e159ed2e3d806bc76ff193a43 # v4.7.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 | ||
|
DevSecNinja marked this conversation as resolved.
Resolved
|
||
| # lint-include.yml runs no linter unless it is set to true. | ||
| lint-gitleaks: true | ||
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,15 @@ | ||
| # Tool versions for this repository, pinned and Renovate-managed (mise manager). | ||
| # These are the lint tools run by the shared lint workflow | ||
| # (DevSecNinja/.github .github/workflows/lint.yml). The workflow installs from | ||
| # this config and fails with guidance if a tool it needs is not pinned here. | ||
| [tools] | ||
| dprint = "0.64.3" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| yamlfmt = "0.21.0" | ||
| actionlint = "1.7.12" | ||
| gitleaks = "8.30.1" | ||
| shellcheck = "0.11.0" | ||
| shfmt = "3.14.1" | ||
| trivy = "0.76.1" | ||
|
DevSecNinja marked this conversation as resolved.
Resolved
|
||
| zizmor = "1.31.1" | ||
|
DevSecNinja marked this conversation as resolved.
Resolved
|
||
| "pipx:yamllint" = "1.38.0" | ||
| "pipx:checkov" = "3.4.0" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
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.