Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

During Codespaces prebuild (GitHub Actions environment), artifacts-helper shims should not attempt Azure DevOps authentication, as indicated by the presence of ACTIONS_ID_TOKEN_REQUEST_URL.

Changes

  • Modified auth-ado.sh to detect GitHub Actions environment and bypass authentication wait
  • Updated all shim scripts (dotnet, nuget, npm, yarn, npx, pnpm, pnpx, rush, rush-pnpm) to check for ACTIONS_ID_TOKEN_REQUEST_URL at the beginning and bypass all Azure DevOps-specific operations when set:
    • Skip credential provider installation (for dotnet/nuget shims)
    • Skip setting Azure DevOps environment variables (VSS_NUGET_ACCESSTOKEN, VSS_NUGET_URI_PREFIXES, ARTIFACTS_ACCESSTOKEN)
    • Skip waiting for auth helper
    • Execute the real command directly without any overhead
  • Bumped feature version to 3.0.1
  • Added documentation in NOTES.md explaining the GitHub Actions / Codespaces Prebuild support
# Each shim now checks at the beginning
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
  source "$(dirname $0)"/resolve-shim.sh
  DOTNET_EXE="$(resolve_shim)"
  "${DOTNET_EXE}" "$@"
  exit $?
fi

Without this fix, package restore operations during prebuild would wait up to 3 minutes for an auth helper that isn't needed in that context, and would unnecessarily install credential providers and set environment variables that could interfere with the GitHub Actions workflow.

Original prompt

On artifacts-helper, A problem with the new artifacts-helper shims is that when someone tries to run dotnet/nuget/npm/yarn during Codespaces creation this process gets in the way. We do NOT want the shims in that scenario and need to execute the real command. We can detect this scenario by the presence of the ACTIONS_ID_TOKEN_REQUEST_URL environment variable. When this variable is set, the shim should not try to obtain an Azure DevOps token and should just proceed to calling the real command


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix artifacts-helper shims to bypass commands during Codespaces Skip Azure DevOps auth in shims when ACTIONS_ID_TOKEN_REQUEST_URL is set Dec 15, 2025
Copilot AI requested a review from markphip December 15, 2025 15:42
@markphip
Copy link
Contributor

@copilot I think the actual shim scripts also need to be modified because the things they do to set an enviornment variable as part of running the tool will also cause issues

Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot I think the actual shim scripts also need to be modified because the things they do to set an enviornment variable as part of running the tool will also cause issues

Good catch! Updated all shim scripts to bypass Azure DevOps-specific operations when ACTIONS_ID_TOKEN_REQUEST_URL is set. This now skips:

  • Credential provider installation (dotnet/nuget)
  • Setting VSS_NUGET_ACCESSTOKEN and VSS_NUGET_URI_PREFIXES
  • Setting ARTIFACTS_ACCESSTOKEN
  • Waiting for auth helper

The shims now execute the real command directly in GitHub Actions context. Commit: 434e7c2

Reorganize GitHub Actions prebuild support section for clarity and update details on shim scripts behavior.
@markphip markphip marked this pull request as ready for review December 15, 2025 15:59
@markphip markphip merged commit 655b5fc into main Dec 15, 2025
6 checks passed
@markphip markphip deleted the copilot/fix-artifacts-helper-shims branch December 15, 2025 16:03
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.

2 participants