Skip to content

fix(ci): repair YAML block-scalar in workflow-linter Check Permissions step#56

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/workflow-linter-yaml-block-escape
May 14, 2026
Merged

fix(ci): repair YAML block-scalar in workflow-linter Check Permissions step#56
hyperpolymath merged 1 commit into
mainfrom
fix/workflow-linter-yaml-block-escape

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

workflow-linter.yml fails with 0 jobs in 0 seconds because of a YAML block-scalar bug at the "Check Permissions Declaration" step. The run: | block contains:

            echo "Add 'permissions:
  contents: read' at workflow level"

The second line has only 2 spaces of leading indent, which is LESS than the 10-space indent of the run: | block scalar. YAML terminates the block at the first line and treats contents: read' at workflow level" as a top-level mapping fragment — making the whole workflow invalid. GitHub Actions then rejects the workflow during validation, completing the run with no jobs spawned.

Mirrors hyperpolymath/stapeln#35 — same regex-targeted fix that replaces the broken 2-line echo with two valid one-line echoes preserving the user-facing message:

            echo "Add 'permissions:'"
            echo "  contents: read' at workflow level"

After this fix, the Workflow Security Linter actually runs and reports SPDX/permissions/SHA-pin/duplicate findings as designed.

…s step

`workflow-linter.yml` fails with 0 jobs in 0 seconds because of a YAML block-scalar bug at the "Check Permissions Declaration" step. The `run: |` block contains:

```yaml
            echo "Add 'permissions:
  contents: read' at workflow level"
```

The second line has only 2 spaces of leading indent, which is LESS than the 10-space indent of the `run: |` block scalar. YAML terminates the block at the first line and treats `  contents: read' at workflow level"` as a top-level mapping fragment — making the whole workflow invalid. GitHub Actions then rejects the workflow during validation, completing the run with no jobs spawned.

Mirrors hyperpolymath/stapeln#35 — same regex-targeted fix that replaces the broken 2-line echo with two valid one-line echoes preserving the user-facing message:

```yaml
            echo "Add 'permissions:'"
            echo "  contents: read' at workflow level"
```

After this fix, the Workflow Security Linter actually runs and reports SPDX/permissions/SHA-pin/duplicate findings as designed.
@hyperpolymath hyperpolymath merged commit 8075005 into main May 14, 2026
0 of 20 checks passed
@hyperpolymath hyperpolymath deleted the fix/workflow-linter-yaml-block-escape branch May 14, 2026 15:41
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