Add OTLP github-app pre-setup token minting, setup input wiring, and OIDC permission validation#35089
Add OTLP github-app pre-setup token minting, setup input wiring, and OIDC permission validation#35089Copilot wants to merge 27 commits into
github-app pre-setup token minting, setup input wiring, and OIDC permission validation#35089Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| - **`observability:`** - Workflow observability and telemetry configuration (object) | ||
| - **`otlp:`** - Export OpenTelemetry spans to any OTLP-compatible backend (Honeycomb, Grafana Tempo, Sentry, etc.) (object) | ||
| - `endpoint:` - OTLP collector endpoint URL. When a static URL is provided, its hostname is added to the AWF firewall allowlist automatically. Supports GitHub Actions expressions. | ||
| - `auth:` - Optional runtime auth configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds an observability.otlp.auth frontmatter block to support minting a GitHub Actions OIDC token before actions/setup, then wiring that token into the setup action/script so OTLP exports can include an Authorization: Bearer <token> header early in job execution.
Changes:
- Extend workflow frontmatter/types/schema/docs to support
observability.otlp.auth.type: github-oidc(+ optionalaudience). - Generate a compiler-managed pre-setup step (
mint-otlp-oidc-token) and pass its output into setup (action + script modes). - Update setup action runtime to accept
otlp-oidc-tokenand merge it intoOTEL_EXPORTER_OTLP_HEADERS.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/setup_step_version_test.go | Adds compiler tests asserting the OIDC mint step is injected and ordered before setup (action + script modes). |
| pkg/workflow/observability_otlp.go | Adds helpers to detect github-oidc auth and read optional audience from parsed/raw frontmatter. |
| pkg/workflow/observability_otlp_test.go | Adds unit tests for the new OTLP auth parsing helpers. |
| pkg/workflow/frontmatter_types.go | Introduces OTLPAuthConfig and wires it into OTLPConfig. |
| pkg/workflow/compiler_yaml_step_generation.go | Emits the pre-setup OIDC mint step and wires its token into setup inputs/env. |
| pkg/workflow/codex_engine.go | Formatting-only change in env map alignment. |
| pkg/parser/schemas/main_workflow_schema.json | Extends the JSON schema with observability.otlp.auth. |
| actions/setup/js/action_setup_otlp.test.cjs | Adds tests for OIDC token -> header injection behavior. |
| actions/setup/js/action_setup_otlp.cjs | Merges OIDC token into OTEL_EXPORTER_OTLP_HEADERS and writes it to GITHUB_ENV. |
| actions/setup/index.js | Plumbs otlp-oidc-token input to setup.sh and the OTLP span sender. |
| actions/setup/action.yml | Adds the new otlp-oidc-token action input. |
| .github/workflows/dead-code-remover.lock.yml | Regenerated lock workflow metadata/manifest. |
| .github/aw/syntax.md | Documents the new observability.otlp.auth fields and example usage. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 12/13 changed files
- Comments generated: 4
| const inputOTLPOIDCToken = getActionInput("OTLP_OIDC_TOKEN"); | ||
| if (inputOTLPOIDCToken) { | ||
| const existingHeaders = process.env.OTEL_EXPORTER_OTLP_HEADERS || ""; | ||
| const hasAuthorizationHeader = /(^|,)\s*authorization\s*=/i.test(existingHeaders); | ||
| const mergedHeaders = hasAuthorizationHeader ? existingHeaders : (existingHeaders ? `${existingHeaders},` : "") + "Authorization=Bearer " + inputOTLPOIDCToken; | ||
|
|
||
| process.env.OTEL_EXPORTER_OTLP_HEADERS = mergedHeaders; | ||
| writeEnvLine(process.env.GITHUB_ENV, "OTEL_EXPORTER_OTLP_HEADERS", mergedHeaders, "OTEL_EXPORTER_OTLP_HEADERS", "GITHUB_ENV"); | ||
| } |
| func (c *Compiler) generateOTLPOIDCMintStep(data *WorkflowData) []string { | ||
| if data == nil || !hasOTLPGitHubOIDCAuth(data.ParsedFrontmatter, data.RawFrontmatter) { | ||
| return nil | ||
| } |
| - **`otlp:`** - Export OpenTelemetry spans to any OTLP-compatible backend (Honeycomb, Grafana Tempo, Sentry, etc.) (object) | ||
| - `endpoint:` - OTLP collector endpoint URL. When a static URL is provided, its hostname is added to the AWF firewall allowlist automatically. Supports GitHub Actions expressions. | ||
| - `auth:` - Optional runtime auth configuration. | ||
| - `type:` - `github-oidc` to mint a GitHub Actions OIDC credential before `actions/setup` and use it for OTLP Authorization headers. | ||
| - `audience:` - Optional OIDC audience passed to `core.getIDToken(audience)`. |
| describe("OTLP OIDC token header injection", () => { | ||
| it("injects Authorization header and exports it to GITHUB_ENV when INPUT_OTLP_OIDC_TOKEN is set", async () => { | ||
| const minted = "oidc" + "-" + "token" + "-" + "value"; | ||
| process.env.INPUT_OTLP_OIDC_TOKEN = minted; | ||
|
|
||
| await run(); | ||
|
|
||
| expect(process.env.OTEL_EXPORTER_OTLP_HEADERS).toContain("Authorization=Bearer "); | ||
| expect(process.env.OTEL_EXPORTER_OTLP_HEADERS).toContain(minted); | ||
| expect(readFileSync(envFile, "utf8")).toContain("OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer "); | ||
| }); | ||
|
|
||
| it("does not override existing Authorization header", async () => { | ||
| process.env.INPUT_OTLP_OIDC_TOKEN = "oidc" + "-second" + "-value"; | ||
| process.env.OTEL_EXPORTER_OTLP_HEADERS = "Authorization=******"; | ||
|
|
||
| await run(); | ||
|
|
||
| expect(process.env.OTEL_EXPORTER_OTLP_HEADERS).toBe("Authorization=******"); | ||
| }); | ||
| }); |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
github-oidc pre-setup token minting and setup input wiringgithub-app (github-oidc) pre-setup token minting and setup input wiring
|
|
|
Please fix the OTLP header propagation gap in GH_AW_OTLP_ENDPOINTS, then re-request review.
|
|
@copilot review all comments and reviews |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed the actionable review items in commits f2b547b and 33994c6:
|
github-app (github-oidc) pre-setup token minting and setup input wiringgithub-app (github-oidc) pre-setup token minting, setup input wiring, and OIDC permission validation
|
@copilot reuse Go type to represent GitHub-app data and helper functions to generate action create GitHub app step . Type GitHub-oidc is implicit and does not need to be in frontmatter . |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🛠️ Agentic Maintenance updated this pull request branch. |
|
@copilot the sample should look like this: |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
github-app pre-setup OIDC token minting, setup input wiring, and OIDC permission validationgithub-app pre-setup token minting, setup input wiring, and OIDC permission validation
| { | ||
| "$ref": "#/$defs/github_app" | ||
| }, | ||
| { |
There was a problem hiding this comment.
@copilot remove type: github-oidc syntax support, no legacy support.
There was a problem hiding this comment.
Implemented in d6b640b (with follow-up commits in this stack): removed OTLP observability.otlp.github-app.type: github-oidc legacy syntax support from main_workflow_schema.json, updated syntax docs to describe implicit OIDC without type, and added parser schema tests to ensure audience-only config is accepted while legacy type syntax is rejected.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot simplify GitHub-app type in schema. Remove oneof, audience, |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 81dd667. I simplified |
|
`` Please address the unresolved OIDC/token wiring feedback and validate the id-token: write permission before minting.
|
This change adds OTLP runtime auth configuration in frontmatter so workflows can mint a bearer credential for telemetry export before
actions/setup, then pass it into setup for OTLP Authorization header injection early in job execution.Frontmatter + schema
observability.otlp.github-appwith support for:app-id/client-id+private-key) to mint a token viaactions/create-github-app-tokengithub-appblock is present without credentialsgithub-appschema by removing the OTLP-specificoneOfbranch and removingaudiencesupport.type: github-oidcsyntax support for OTLPgithub-app.github-appauth block and helper flow.Workflow generation
mint-otlp-oidc-token) that now:actions/create-github-app-tokenwhen OTLPgithub-appcredentials are providedactions/github-script+core.getIDToken(...)for OIDC modewith.otlp-oidc-tokenINPUT_OTLP_OIDC_TOKENpermissions.id-token: writeis required for OTLP OIDC mode.Setup action behavior
otlp-oidc-tokeninactions/setup/action.yml.action_setup_otlp.cjs, when provided, mergesAuthorization=******intoOTEL_EXPORTER_OTLP_HEADERS(without overriding an existing Authorization header) and exports it viaGITHUB_ENV.GH_AW_OTLP_ENDPOINTSendpointheadersvalue (without overriding existing Authorization) and persists updated endpoints viaGITHUB_ENV, so setup/conclusion span export paths use the minted token.Docs + tests
github-appcredential usage and OIDC permission guidance.GH_AW_OTLP_ENDPOINTS, OIDC permission validation behavior, OTLP GitHub App helper extraction, schema acceptance of implicit OIDC (github-app: {}), schema rejection of OTLPgithub-app.audience, schema rejection of legacytype: github-oidc, and integration fixtures asserting emittedactions/create-github-app-tokenusage.Example