Skip to content

fix(ci): move secret-scanner Cargo.toml gate from job-level if: to step-level#57

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/secret-scanner-job-level-hashfiles
May 14, 2026
Merged

fix(ci): move secret-scanner Cargo.toml gate from job-level if: to step-level#57
hyperpolymath merged 1 commit into
mainfrom
fix/secret-scanner-job-level-hashfiles

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

secret-scanner.yml has had 0 successful runs since creation across all estate consumers — every run completes in 0 seconds with conclusion=failure and zero jobs spawned (GitHub Actions startup_failure). YAML is syntactically valid; both action SHAs exist; gh workflow view returns the file cleanly.

Root cause

The rust-secrets job has a job-level if: clause:

  rust-secrets:
    runs-on: ubuntu-latest
    if: hashFiles('**/Cargo.toml') != ''

GitHub Actions does not support hashFiles() in job-level if: conditions. The docs say hashFiles is "available in the runtime environment when steps are running" — i.e. step-level only. At job-eligibility time the expression evaluator rejects the workflow, no jobs are scheduled, the run is marked as a failed startup. Wrapping in ${{ }} makes no difference.

Fix

Mirrors hyperpolymath/stapeln#36. Removes the job-level if: line and adds a step-level guard at the top of the existing run block:

if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
  echo "No Cargo.toml found — skipping Rust secrets check"
  exit 0
fi

Same semantics (skip when no Cargo.toml), but at a context where the expression works.

After this fix, the Secret Scanner workflow actually runs trufflehog + gitleaks + (conditionally) rust-secrets as designed.

…ep-level

`secret-scanner.yml` has had 0 successful runs since creation across all estate consumers — every run completes in 0 seconds with `conclusion=failure` and zero jobs spawned (GitHub Actions startup_failure). YAML is syntactically valid; both action SHAs exist; `gh workflow view` returns the file cleanly.

## Root cause

The `rust-secrets` job has a job-level `if:` clause:

```yaml
  rust-secrets:
    runs-on: ubuntu-latest
    if: hashFiles('**/Cargo.toml') != ''
```

GitHub Actions does not support `hashFiles()` in **job-level** `if:` conditions. The docs say `hashFiles` is "available in the runtime environment when steps are running" — i.e. step-level only. At job-eligibility time the expression evaluator rejects the workflow, no jobs are scheduled, the run is marked as a failed startup. Wrapping in ${{ }} makes no difference.

## Fix

Mirrors hyperpolymath/stapeln#36. Removes the job-level `if:` line and adds a step-level guard at the top of the existing run block:

```bash
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
  echo "No Cargo.toml found — skipping Rust secrets check"
  exit 0
fi
```

Same semantics (skip when no `Cargo.toml`), but at a context where the expression works.

After this fix, the Secret Scanner workflow actually runs trufflehog + gitleaks + (conditionally) rust-secrets as designed.
@hyperpolymath
hyperpolymath merged commit 9a91a6f into main May 14, 2026
18 of 21 checks passed
@hyperpolymath
hyperpolymath deleted the fix/secret-scanner-job-level-hashfiles branch May 14, 2026 15:30
hyperpolymath added a commit that referenced this pull request Jul 17, 2026
check-licence-consistency.sh classified MPL-2.0, PMPL-1.0, GPL-3.0,
Apache-2.0, MIT and BSD-3-Clause verbatim texts, but had no AGPL-3.0
template. A repo with a full-text GNU AFFERO GPL LICENSE (and no SPDX
header line) therefore classified as UNKNOWN and failed the check.

This forced the estate's deliberate AGPL exceptions (the co-developed-with-son
games) into an SPDX-stub LICENSE to pass — which GitHub then reads as
NOASSERTION/"Other" rather than AGPL. It also actively rejected
airborne-submarine-squadron once its wrongly-clobbered MPL LICENSE was
restored to its intended AGPL (asq PR #57): the check passed the wrong state
and failed the right one.

Add has_agpl (matches "GNU AFFERO GENERAL PUBLIC LICENSE"), classified before
plain GPL-3.0 so the Affero title wins. A full-text AGPL LICENSE is now
accepted as a canonical licence file, so AGPL repos can use GitHub-detectable
full text like the MPL repos already do.

Verified: modified script exits 0 against airborne-submarine-squadron
(full-text AGPL) and still exits 0 against nextgen-typing (MPL) — no regression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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