Skip to content

ci: check project formatting with Nix - #468

Merged
robjtede merged 4 commits into
mainfrom
agent/ci-fast-nix-format
Aug 2, 2026
Merged

ci: check project formatting with Nix#468
robjtede merged 4 commits into
mainfrom
agent/ci-fast-nix-format

Conversation

@robjtede

@robjtede robjtede commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • add a focused ci-format devshell containing only the repository formatting tools
  • install upstream Nix with the quick single-user installer
  • keep nicknovitski/nix-develop as a separate setup step
  • replace the Rustfmt-only lint job with full repository formatting
  • use no additional Nix cache

Why

The existing Blacksmith job checks only Rust formatting. This applies the fastest repeatable Nix setup measured in xwc while expanding coverage to the Justfile, Nix, Markdown, YAML, TOML, and Rust sources through just fmt.

The native Linux, macOS, and Windows test and release jobs remain unchanged.

Timing

Configuration Samples Median
Blacksmith Rustfmt-only baseline 18s, 19s 18.5s
Blacksmith full project formatting 26s, 22s, 22s 22s

The broader formatting check adds approximately 3.5 seconds at the median. Across the three new samples, installing Nix took 0–1 seconds and entering the devshell took 6–8 seconds.

Validation

  • nix develop .#ci-format -c just fmt
  • nix flake check --no-build --all-systems
  • git diff --check
  • three successful Blacksmith format-job samples
  • all GitHub Actions checks pass on Linux, macOS, and Windows

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a CI check for project formatting with Nix.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@robjtede
robjtede marked this pull request as ready for review August 2, 2026 01:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/lint.yml:
- Line 39: Update the runs-on configuration using the
blacksmith-2vcpu-ubuntu-2404 label: declare it under self-hosted-runner.labels
in .github/actionlint.yaml if it is an intended self-hosted label, otherwise
replace it with a supported hosted runner label.
- Line 41: Update the actions/checkout step in the format job to set
persist-credentials to false, leaving the pinned checkout action reference
unchanged.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd51ac86-1668-4810-a0bf-927a15ef5559

📥 Commits

Reviewing files that changed from the base of the PR and between 8506acc and f65d51e.

📒 Files selected for processing (2)
  • .github/workflows/lint.yml
  • flake.nix


rustfmt:
project-format:
runs-on: blacksmith-2vcpu-ubuntu-2404

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 2 'blacksmith-2vcpu-ubuntu-2404' \
  .github/workflows/lint.yml actionlint.yaml 2>/dev/null || true

Repository: x52dev/inspect-cert-chain

Length of output: 983


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Workflows and actionlint config files:\n'
git ls-files '.github/workflows/*' 'actionlint.yaml' 'actionlint.yml' 'actionlint.json' 2>/dev/null || true

printf '\nRelevant workflow runner labels:\n'
rg -n 'runs-on:|blacksmith' .github/workflows || true

printf '\nActionlint config existence and content:\n'
for f in actionlint.yaml actionlint.yml actionlint.json .github/actionlint.yaml .github/actionlint.yml .github/actionlint.json; do
  [ -f "$f" ] && { printf '\n== %s ==\n' "$f"; cat -n "$f"; }
done

Repository: x52dev/inspect-cert-chain

Length of output: 860


🌐 Web query:

GitHub actionlint unknown runner label actionlint.yaml

💡 Result:

The "unknown runner label" error in actionlint occurs when a workflow uses a runs-on label that is not part of the standard, GitHub-hosted runner set [1][2]. This commonly happens when using custom, self-hosted runner labels [3][4]. To resolve this, you must explicitly declare your custom runner labels in an actionlint.yaml configuration file within your repository's .github directory [5][1]. Configuration Steps: 1. Create or update the configuration file: .github/actionlint.yaml [5]. 2. Add the self-hosted-runner section and list your custom labels under labels [5]: yaml # .github/actionlint.yaml self-hosted-runner: labels: - your-custom-label-1 - your-custom-label-2 Alternatively, you can generate a default configuration file automatically by running [5]: actionlint -init-config If you prefer to suppress these warnings without declaring labels, you can use the -ignore flag when running actionlint [3][6]: actionlint -ignore 'label ".+" is unknown' For more advanced configuration, glob patterns are supported in the labels list if you need to match multiple similar labels [5].

Citations:


Declare the custom runner label for actionlint.

blacksmith-2vcpu-ubuntu-2404 is not a documented hosted runner label. If this is a self-hosted runner label, add it to .github/actionlint.yaml under self-hosted-runner.labels; otherwise, switch the jobs to a supported runner label.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 39-39: label "blacksmith-2vcpu-ubuntu-2404" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint.yml at line 39, Update the runs-on configuration
using the blacksmith-2vcpu-ubuntu-2404 label: declare it under
self-hosted-runner.labels in .github/actionlint.yaml if it is an intended
self-hosted label, otherwise replace it with a supported hosted runner label.

Source: Linters/SAST tools

project-format:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 4 \
  'pull_request|pull_request_target|actions/checkout|persist-credentials|permissions|git (fetch|push)' \
  .github/workflows/lint.yml

Repository: x52dev/inspect-cert-chain

Length of output: 1363


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Workflow trigger and job summary:"
sed -n '1,120p' .github/workflows/lint.yml

echo
echo "Subsequent steps in format job with relevant git/authentication commands:"
python3 - <<'PY'
from pathlib import Path
p=Path('.github/workflows/lint.yml')
text=p.read_text()
lines=text.splitlines()
in_format=False
indent=0
for i,line in enumerate(lines,1):
    if i==38: in_format=True; indent=2
    if in_format:
        if line.startswith('  docs:') or (line.startswith('jobs:') and i<38): continue
        if line.startswith(' ') and len(line)-len(line.lstrip()) <= indent:
            if i>38:
                in_format=False
        if in_format:
            print(f"{i}: {line}")
PY

echo
echo "Files mentioning Justfile and zizmor:"
rg -n 'Justfile|zizmor|artipacked|pull_request_target|pull_request:' .

Repository: x52dev/inspect-cert-chain

Length of output: 3835


🌐 Web query:

actions/checkout persist-credentials default true README

💡 Result:

In the actions/checkout GitHub Action, the persist-credentials input controls whether the authentication token or SSH key used for checking out the repository is configured in the local git configuration [1][2]. Key details include: Default behavior: The default value for persist-credentials is true [1][3]. Purpose: When enabled (true), it allows your workflow scripts to run authenticated git commands (such as git push or git pull) without needing to manually re-authenticate [1][2]. Cleanup: The action automatically removes these credentials during the post-job cleanup phase [1][4]. Opting out: You can set persist-credentials: false if you do not want the action to store the authentication credentials in the local git config [1][3]. Starting with version v6.0.0, the action was updated to store these credentials under $RUNNER_TEMP rather than directly in the local git configuration, which requires a runner version of at least v2.329.0 for compatibility with Docker container actions [3].

Citations:


🌐 Web query:

Zizmor audits artipacked persist-credentials false

💡 Result:

The artipacked audit in zizmor is a security check designed to detect the unintentional persistence of credentials within GitHub Actions workflows, specifically targeting the default behavior of the actions/checkout action [1]. By default, actions/checkout persists authentication credentials (such as the GITHUB_TOKEN) to the runner's filesystem to enable subsequent git operations [2][3]. If a workflow creates artifacts that include the checked-out repository contents, these credentials can be inadvertently exposed or leaked [1][3]. Zizmor flags this behavior and recommends setting persist-credentials: false in your actions/checkout configuration unless those credentials are explicitly required for subsequent git operations [1]. Key aspects of the artipacked audit include: Severity and Versioning: Zizmor adjusts the severity of artipacked findings based on the version of actions/checkout used [1][4]. Since version 6.0.0, actions/checkout stores credentials in a more isolated location ($RUNNER_TEMP) rather than the repository's.git/config, which reduces (though does not eliminate) the risk of leakage [1][4][2]. Consequently, zizmor typically assigns lower severity findings to workflows using actions/checkout@v6 or later [1][4]. Configuration: The audit explicitly looks for the absence of persist-credentials: false within the with: block of the checkout step [1][5]. While zizmor aims for high signal-to-noise, it has received feedback regarding false positives when developers use expressions for this setting or when the workflow's specific permission context (e.g., contents: read) makes persistence less risky, leading to ongoing efforts to refine its precision [6][7][5]. Remediation: The standard remediation suggested by zizmor is to explicitly set persist-credentials: false for any checkout step that does not strictly require persisted git credentials [1]. For workflows that legitimately require git operations (e.g., git push), the finding can be ignored or suppressed based on the project's specific security requirements [7].

Citations:


🌐 Web query:

site:github.com/zizmorcore/zizmor artifacts zizmor-artifacts leak persisted credentials

💡 Result:

Zizmor is a static analysis tool for GitHub Actions that includes an audit check named artipacked designed to detect risks related to credential persistence and leakage [1][2]. The artipacked check specifically focuses on the default behavior of the actions/checkout action, which persists Git credentials on the runner's local filesystem [3][2]. By default, persist-credentials is set to true [4][2]. If these credentials remain on the disk, subsequent steps in the workflow—such as actions/upload-artifact—may inadvertently archive and upload the entire workspace (including the persisted credentials) as a job artifact [4][2]. If the resulting artifact is publicly accessible or stored in a way that allows unauthorized access, this can lead to the exposure of the credentials [4][2]. To mitigate this risk, zizmor recommends setting persist-credentials to false in your actions/checkout step, unless the credentials are explicitly required for subsequent Git operations [5][2]: - uses: actions/checkout@v4 with: persist-credentials: false Zizmor can identify these vulnerable patterns in workflow definitions and, in many cases, provides an automated fix to apply this configuration [5][4]. The tool is designed to be a static analysis utility, meaning it does not execute code or access runtime state; instead, it inspects workflow and action files to suggest these security improvements [6].

Citations:


Disable checkout credential persistence.

This format job does not need authenticated Git after checkout. actions/checkout persists credentials by default, and this workflow has no subsequent authenticated Git operation that requires them. Set persist-credentials: false in the checkout step.

🧰 Tools
🪛 zizmor (1.28.0)

[warning] 41-41: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint.yml at line 41, Update the actions/checkout step in
the format job to set persist-credentials to false, leaving the pinned checkout
action reference unchanged.

Source: Linters/SAST tools

@robjtede
robjtede merged commit 8a05daf into main Aug 2, 2026
11 checks passed
@robjtede
robjtede deleted the agent/ci-fast-nix-format branch August 2, 2026 01:47
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

The agent generated fixes only for .github/workflows/ files, which cannot be committed due to permission restrictions. Please apply these changes manually.


⚠️ 1 file(s) could not be committed — the agent does not have permission to push to .github/workflows/. Please apply these changes manually:

.github/workflows/lint.yml — 1 change:

Lines 39–44
     runs-on: blacksmith-2vcpu-ubuntu-2404
     steps:
       - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
 
       - name: Install Nix
         uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant