Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# Fish and Zsh are required so the validation BATS tests do not
# skip syntax/startup checks against shell configurations.
# See: tests/bash/validate-fish-config.bats, tests/bash/test-clean-shell-startup.bats
run: |

Check warning on line 66 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'validate', step 'Install shells required by validation tests': multiple lines. Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends fish zsh

Expand All @@ -71,13 +71,13 @@
# Chezmoi is required so the validation BATS tests can verify
# the chezmoi configuration and dry-run apply rather than skipping.
# See: tests/bash/validate-chezmoi.bats, tests/bash/test-chezmoi-apply.bats
run: |

Check warning on line 74 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'validate', step 'Install pinned Chezmoi': multiple lines. Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
mise install chezmoi
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"

- name: Run lefthook checks (pull request changes)
if: github.event_name == 'pull_request'
run: |

Check warning on line 80 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'validate', step 'Run lefthook checks (pull request changes)': multiple lines, a command list (&&, ||, ; or &), command substitution ($(...), backticks or <(...)), a heredoc or here-string (<<), shell control flow (if, for, while, case, ...), a ${{ }} expression (pass it through env: instead). Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
git fetch --no-tags --prune --depth=1 origin "${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
changed_files="$(git diff --name-only --diff-filter=ACMR "origin/${{ github.base_ref }}" HEAD)"
if [ -z "$changed_files" ]; then
Expand Down Expand Up @@ -115,7 +115,7 @@

- name: Set lowercase repository owner
id: lowercase
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"

Check warning on line 118 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'test-devcontainer', step 'Set lowercase repository owner': command substitution ($(...), backticks or <(...)), a ${{ }} expression (pass it through env: instead). Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.

- name: Log in to GitHub Container Registry
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
Expand All @@ -136,7 +136,7 @@
run: npm install -g @devcontainers/cli

- name: Build and start devcontainer
run: |

Check warning on line 139 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'test-devcontainer', step 'Build and start devcontainer': multiple lines, a ${{ }} expression (pass it through env: instead). Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
set -e
echo "🏗️ Building and starting devcontainer from .devcontainer/devcontainer.json..."

Expand All @@ -150,13 +150,13 @@
echo "✅ Devcontainer built and started successfully"

- name: Move cache
run: |

Check warning on line 153 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'test-devcontainer', step 'Move cache': multiple lines, a command list (&&, ||, ; or &). Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
# Move cache to avoid growing cache size indefinitely
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true

- name: Test devcontainer deployment
run: |

Check warning on line 159 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'test-devcontainer', step 'Test devcontainer deployment': multiple lines. Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
set -e
echo "🧪 Running tests inside the devcontainer..."

Expand Down Expand Up @@ -192,7 +192,7 @@
run: ./home/install.sh

- name: Verify Chezmoi installation
run: |

Check warning on line 195 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint / inline scripts

Inline script

Job 'test-install', step 'Verify Chezmoi installation': multiple lines, a pipe (|), a command list (&&, ||, ; or &), command substitution ($(...), backticks or <(...)), shell control flow (if, for, while, case, ...). Move the code to a script under scripts/ or .github/scripts/ and call it with one command, or opt out with '# lint: allow-inline-script <reason>'.
if ! command -v chezmoi >/dev/null 2>&1; then
echo "❌ Chezmoi not found"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/devcontainer-prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

- name: Set lowercase repository owner
id: lowercase
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"

- name: Log in to GitHub Container Registry
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:

- name: Set lowercase repository owner
id: lowercase
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"

- name: Determine release context
id: release
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/lint.yml
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/*"
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ jobs:
# CHANGELOG slice as plain markdown.
gh release view "${TAG}" --repo "${REPO}" --json body --jq '.body' >/tmp/release-notes.md
# Append the log.sh consumption + provenance verification block.
# The single-quoted printf lines print a shell snippet whose $tmp and
# $HOME must stay literal, so SC2016 doesn't apply.
# shellcheck disable=SC2016
{
printf '\n\n---\n\n'
printf '## log.sh distribution\n\n'
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/secret-scan.yml
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

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
# lint-include.yml runs no linter unless it is set to true.
lint-gitleaks: true
12 changes: 0 additions & 12 deletions .github/workflows/sign-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ jobs:
Merging this PR replaces the direct push the workflow used to
perform, which is blocked by branch protection on `main`.

- name: Comment on PR
if: steps.check_changes.outputs.changes == 'true' && github.event_name == 'pull_request'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ PowerShell scripts have been signed. Please pull the latest changes after merge.'
})

# --- Page on main-branch script-signing failure (homelab IRM pager) ---
notify-irm:
name: Notify Grafana IRM
Expand Down
17 changes: 14 additions & 3 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ bats = "1.14.0"
# Lefthook for managing git hooks
lefthook = "latest"

# Shell linting and formatting (used by lefthook hooks)
shellcheck = "latest"
shfmt = "latest"
# Shell linting and formatting (used by lefthook hooks and
# .github/workflows/lint.yml, which needs exact versions; Renovate keeps them current)
shellcheck = "0.11.0"
shfmt = "3.14.1"

# The other 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"
trivy = "0.76.1"
zizmor = "1.31.1"
"pipx:yamllint" = "1.38.0"
"pipx:checkov" = "3.4.0"

# Release tooling: cocogitto drives `cog bump`, git-cliff renders CHANGELOG.md
# and release notes. See cog.toml, cliff.toml, .github/workflows/release.yml.
Expand Down
9 changes: 4 additions & 5 deletions docs/yubikey.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ re-prompt for the FIDO2 PIN, so the second `ssh` call fails with:
sign_and_send_pubkey: signing failed for ED25519-SK "..." from agent: agent refused operation
```

Letting OpenSSH talk to the YubiKey directly each time keeps the touch

- PIN dance interactive and reliable. If you ever land in the broken
state (e.g. you ran an older config that did `AddKeysToAgent yes`),
clear the agent and you're back in business:
Letting OpenSSH talk to the YubiKey directly each time keeps the
touch + PIN dance interactive and reliable. If you ever land in the broken
state (e.g. you ran an older config that did `AddKeysToAgent yes`),
clear the agent and you're back in business:

```bash
ssh-add -D # drop all cached keys
Expand Down
Loading