Skip to content

Fix sequential OIDC authentication with exported tokens - #47

Merged
cloudsmith-iduffy merged 2 commits into
masterfrom
cloudsmith-iduffy-sequential-oidc-authentication
Sep 10, 2026
Merged

Fix sequential OIDC authentication with exported tokens#47
cloudsmith-iduffy merged 2 commits into
masterfrom
cloudsmith-iduffy-sequential-oidc-authentication

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Running the action twice in one job with export-auth-token: true could reuse the first service account's token even when the second invocation requested a different oidc-service-slug. The inherited CLOUDSMITH_API_KEY took precedence over OIDC, preventing workflows from switching from a pull-only account to a push-capable account.

Both wrappers now hide inherited API keys from the internal credential-helper command when OIDC inputs are supplied without an explicit api-key. Bash scopes the unset to a subshell; PowerShell restores the environment in finally. The resolved token is then validated, masked, and exported for subsequent steps as before.

Explicit api-key precedence and input validation are unchanged. This does not change CLI credential-provider precedence or behavior when token export is disabled.

Copilot AI lite review requested due to automatic review settings September 10, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes sequential OIDC authentication when exported tokens are inherited between action invocations.

Changes:

  • Isolates inherited API keys during OIDC resolution.
  • Adds Bash and PowerShell regression tests.
  • Documents and integrates tests across the CI matrix.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/test-setup.sh Adds Bash regression coverage.
scripts/test-setup.ps1 Adds PowerShell regression coverage.
scripts/setup.sh Isolates inherited API keys during OIDC resolution.
scripts/setup.ps1 Temporarily clears and restores inherited API keys.
CONTRIBUTION.md Documents local regression test commands.
.github/workflows/test.yml Runs linting and platform-specific setup tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-sequential-oidc-authentication branch from b1ed6c2 to c48c105 Compare September 10, 2026 10:52
@cloudsmith-iduffy
cloudsmith-iduffy merged commit 4236041 into master Sep 10, 2026
20 checks passed
@cloudsmith-iduffy cloudsmith-iduffy mentioned this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants