Conversation
…puts steps Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in e2ee8c9. Added 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:
|
There was a problem hiding this comment.
Pull request overview
Adds automatic id-token: write permission handling for the safe-outputs job when user-provided safe-outputs.steps include known OIDC/vault credential actions, with an explicit safe-outputs.id-token override and schema support.
Changes:
- Auto-detects known OIDC/vault actions in
safe-outputs.stepsand addsid-token: writeto computed safe-outputs job permissions. - Adds
safe-outputs.id-token: write|noneoverride parsing to force-enable or opt out of auto-detection. - Extends the main workflow JSON schema to include the new
safe-outputs.id-tokenfield and adds unit tests for detection/permission computation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_permissions.go | Adds OIDC/vault action detection from steps and conditionally sets id-token: write. |
| pkg/workflow/safe_outputs_permissions_test.go | Adds tests for step detection and permission computation around id-token. |
| pkg/workflow/safe_outputs_config.go | Parses new safe-outputs.id-token override from frontmatter. |
| pkg/workflow/compiler_types.go | Extends SafeOutputsConfig with IDToken override field. |
| pkg/parser/schemas/main_workflow_schema.json | Updates schema so safe-outputs.id-token is validated/autocompleted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Strip the @version suffix before matching | ||
| actionRef, _, _ := strings.Cut(uses, "@") |
There was a problem hiding this comment.
stepsRequireIDToken duplicates action-ref parsing logic that already exists in this package (extractActionRepo in pkg/workflow/action_pins.go). Reusing the shared helper would reduce drift and keep behavior consistent across features that inspect uses: strings (e.g., handling of refs without @).
| // Strip the @version suffix before matching | |
| actionRef, _, _ := strings.Cut(uses, "@") | |
| // Use shared helper to extract the action repository from the uses: string | |
| actionRef := extractActionRepo(uses) | |
| if actionRef == "" { | |
| continue | |
| } |
| // Handle id-token permission override ("write" to force-add, "none" to disable auto-detection) | ||
| if idToken, exists := outputMap["id-token"]; exists { | ||
| if idTokenStr, ok := idToken.(string); ok { | ||
| if idTokenStr == "write" || idTokenStr == "none" { | ||
| config.IDToken = &idTokenStr | ||
| safeOutputsConfigLog.Printf("Configured id-token permission override: %s", idTokenStr) | ||
| } else { | ||
| safeOutputsConfigLog.Printf("Warning: unrecognized safe-outputs id-token value %q (expected \"write\" or \"none\"); ignoring", idTokenStr) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
The new safe-outputs.id-token parsing logic isn’t covered by tests that exercise extractSafeOutputsConfig. Adding a focused test for accepted values ("write"/"none") and for ignoring invalid values would help prevent regressions in config parsing.
Enterprise environments use OIDC-based secret managers (AWS Secrets Manager, Azure Key Vault, HashiCorp Vault, etc.) via GitHub Actions steps in
safe-outputs.steps. The safe-outputs job was missingid-token: write, causing OIDC authentication to fail silently.Changes
ComputePermissionsForSafeOutputsnow scanssafe-outputs.stepsfor known OIDC/vault actions and automatically addsid-token: writeto the safe-outputs job permissionsaws-actions/configure-aws-credentials,azure/login,google-github-actions/auth,hashicorp/vault-action,cyberark/conjur-actionid-tokenfield onsafe-outputsallows overriding auto-detection:id-token: write— always add the permission (even if no vault action is detected)id-token: none— suppress auto-detection (opt-out)pkg/parser/schemas/main_workflow_schema.jsonnow includes theid-tokenfield in thesafe-outputsobject definition, enabling IDE autocomplete and schema validationOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.