Skip to content

Reject duplicate workflow keys instead of trusting safe_load - #4

Merged
sittner merged 1 commit into
mainfrom
fix-ci
Aug 3, 2026
Merged

Reject duplicate workflow keys instead of trusting safe_load#4
sittner merged 1 commit into
mainfrom
fix-ci

Conversation

@sittner

@sittner sittner commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The v6.18.40 build never started: my previous commit added a second env: block to the release step rather than merging into the existing one, and GitHub rejects that with "'env' is already defined" before running any job. Merged them.

The reason it got pushed is the check I was relying on: yaml.safe_load accepts duplicate mapping keys and keeps the last one, so the file parsed cleanly here and was rejected there. scripts/lint-workflows.py now loads with a constructor that refuses duplicates, and reports the same location GitHub does - "duplicate key 'env' at line 170, column 9" against "(Line: 170, Col: 9): 'env' is already defined" - plus it fails a workflow with no jobs. Verified against a deliberately broken copy.

The v6.18.40 build never started: my previous commit added a second env:
block to the release step rather than merging into the existing one, and
GitHub rejects that with "'env' is already defined" before running any
job. Merged them.

The reason it got pushed is the check I was relying on: yaml.safe_load
accepts duplicate mapping keys and keeps the last one, so the file parsed
cleanly here and was rejected there. scripts/lint-workflows.py now loads
with a constructor that refuses duplicates, and reports the same location
GitHub does - "duplicate key 'env' at line 170, column 9" against
"(Line: 170, Col: 9): 'env' is already defined" - plus it fails a
workflow with no jobs. Verified against a deliberately broken copy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sittner
sittner merged commit f62cd58 into main Aug 3, 2026
4 checks passed
@sittner
sittner deleted the fix-ci branch August 3, 2026 16:03
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