Skip to content

fix(parse): always emit permissions: {} in workflow YAML output#9

Merged
jccguimaraes merged 1 commit into
mainfrom
fix/permissions-always-deny
Apr 10, 2026
Merged

fix(parse): always emit permissions: {} in workflow YAML output#9
jccguimaraes merged 1 commit into
mainfrom
fix/permissions-always-deny

Conversation

@jccguimaraes
Copy link
Copy Markdown
Contributor

When no permissions block is present in HCL, the workflow now emits permissions: {} (deny all) rather than omitting the key. An empty permissions {} block already emitted {} after the previous fix, but the global ": {}\n" → ":\n" post-processor in marshalWorkflowYAML was silently erasing it. Fixed with a sentinel-swap that protects permissions: {} through the strip.

All 14 affected golden fixtures updated. Explicit unit tests added (TestParsePermissionsDefault) covering: no block, empty block, and scoped permissions.

When no permissions block is present in HCL, the workflow now emits
permissions: {} (deny all) rather than omitting the key. An empty
permissions {} block already emitted {} after the previous fix, but
the global ": {}\n" → ":\n" post-processor in marshalWorkflowYAML was
silently erasing it. Fixed with a sentinel-swap that protects
permissions: {} through the strip.

All 14 affected golden fixtures updated. Explicit unit tests added
(TestParsePermissionsDefault) covering: no block, empty block, and
scoped permissions.
@github-actions
Copy link
Copy Markdown

Go test coverage: 64.9% for commit 827fa38
⚠️ 1 of 19 packages have zero coverage.
  • github.com/yldio/cinzel/internal/test
View coverage for all packages
# Package Name                                     | Coverage
+ github.com/yldio/cinzel                          |    80.0%
+ github.com/yldio/cinzel/internal/ai              |    46.8%
+ github.com/yldio/cinzel/internal/cinzelerror     |    18.2%
+ github.com/yldio/cinzel/internal/command         |    39.5%
+ github.com/yldio/cinzel/internal/filereader      |    50.0%
+ github.com/yldio/cinzel/internal/filewriter      |    88.9%
+ github.com/yldio/cinzel/internal/fsutil          |    68.0%
+ github.com/yldio/cinzel/internal/hclparser       |    62.7%
+ github.com/yldio/cinzel/internal/maputil         |    93.3%
+ github.com/yldio/cinzel/internal/naming          |    93.1%
+ github.com/yldio/cinzel/internal/pin             |    54.8%
- github.com/yldio/cinzel/internal/test            |     0.0%
+ github.com/yldio/cinzel/internal/yamlwriter      |    88.9%
+ github.com/yldio/cinzel/provider/github          |    69.5%
+ github.com/yldio/cinzel/provider/github/action   |    82.1%
+ github.com/yldio/cinzel/provider/github/job      |    92.6%
+ github.com/yldio/cinzel/provider/github/step     |    69.3%
+ github.com/yldio/cinzel/provider/github/workflow |    85.6%
+ github.com/yldio/cinzel/provider/gitlab          |    63.5%

@jccguimaraes jccguimaraes merged commit fc0b359 into main Apr 10, 2026
5 checks passed
@jccguimaraes jccguimaraes deleted the fix/permissions-always-deny branch April 10, 2026 14:24
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