Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot stopped work on behalf of
pelikhan due to an error
March 24, 2026 14:52
Contributor
|
@copilot keep working |
…ock in lock file vulnerability-alerts and other GitHub App-only scopes are not valid GitHub Actions workflow permissions. When declared in the frontmatter, they were incorrectly copied verbatim into the compiled job-level permissions: block, causing GitHub Actions to reject the workflow with a parse error at queue time. Fix: add filterJobLevelPermissions() that routes the raw permissions YAML through the Permissions struct before job-level rendering. RenderToYAML() already skips App-only scopes (lines 278-283 of permissions_operations.go), so the fix is simply ensuring the raw string goes through that path before being used in buildMainJob. The permission-vulnerability-alerts: read entry in create-github-app-token step inputs remains correct and unchanged." Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7798db99-bfd8-4247-bf93-e15d02594865
Contributor
Author
Done — commit
|
Copilot
AI
changed the title
[WIP] Fix vulnerability-alerts job-level workflow permission issue
Fix: vulnerability-alerts incorrectly emitted as job-level workflow permission in compiled lock file
Mar 24, 2026
Contributor
|
@copilot add integration test in pkg/cli/workflows |
Contributor
|
@copilot fix CI / Integration: Workflow Misc Part 2 (pull_request)Failing after 44s |
…ing in pkg/cli Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c364da84-b2d4-4747-8b75-457bd5d70513
Contributor
Author
Done in commit
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot stopped work on behalf of
pelikhan due to an error
March 24, 2026 15:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where
vulnerability-alerts: read(and other GitHub App-only permissions) were incorrectly copied verbatim into the compiled job-levelpermissions:block of.lock.ymlfiles, causing GitHub Actions to reject the workflow with a parse error at queue time.Root Cause
buildMainJobincompiler_main_job.gouseddata.Permissions(the raw frontmatter YAML string) directly as the job-level permissions string. This bypassed the existingRenderToYAML()filter that already skips GitHub App-only scopes (e.g.vulnerability-alerts,members,administration). Those scopes are not valid GitHub Actions workflow permissions and must only appear aspermission-*inputs toactions/create-github-app-token.Changes Made
pkg/workflow/permissions_operations.go: AddedfilterJobLevelPermissions()that routes the raw frontmatter permissions YAML through thePermissionsstruct (NewPermissionsParser → ToPermissions → RenderToYAML), ensuring the existing App-only scope filter is applied before job-level rendering.pkg/workflow/compiler_main_job.go: UpdatedbuildMainJobto callfilterJobLevelPermissions(data.Permissions)instead of usingdata.Permissionsdirectly.pkg/workflow/permissions_operations_test.go: AddedTestFilterJobLevelPermissionsunit tests covering empty, standard, App-only-only, mixed, and shorthand permission inputs — including an explicit assertion that the function returns an empty string when all scopes are App-only.pkg/workflow/github_mcp_app_token_test.go: ExtendedTestGitHubMCPAppTokenWithDependabotToolsetto assert thatvulnerability-alertsdoes not appear in any job-level permissions block in the compiled lock file.pkg/cli/workflows/test-vulnerability-alerts-permission.md: Added canonical workflow fixture withvulnerability-alerts: readand a Dependabot GitHub App toolset, used by the integration test.pkg/cli/compile_permissions_integration_test.go: AddedTestCompileVulnerabilityAlertsPermissionFilteredintegration test that compiles the canonical workflow via the binary, parses the YAML lock file, and assertsvulnerability-alertsis absent from all job-level permissions blocks while remaining present in the App token step inputs.Result
vulnerability-alerts: readno longer appears in the job-levelpermissions:block. It correctly remains only increate-github-app-tokenstep inputs aspermission-vulnerability-alerts: read.Testing
TestFilterJobLevelPermissions— all 8 unit test cases passTestGitHubMCPAppTokenWithDependabotToolset— end-to-end lock file validation passesTestCompileVulnerabilityAlertsPermissionFiltered— integration test compiles canonical workflow and validates job-level permissionsTestWasmGolden_CompileFixtures— golden file tests passmake fmtandmake lintclean (pre-existingnode_moduleslint warnings unrelated to this change)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.