Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/artifacts-helper/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ pip install <package_name> --index-url https://pkgs.dev.azure.com/<org_name>/_pa
When the feed URL is an Azure Artifacts feed pip will use the keyring helper to provide the credentials needed
to download the package.

## GitHub Actions / Codespaces Prebuild Support

**Version 3.0.1+**: The shim scripts now detect when running in a GitHub Actions environment (during Codespaces prebuild) by checking for the `ACTIONS_ID_TOKEN_REQUEST_URL` environment variable. When this variable is set, the shims bypass all Azure DevOps authentication setup and execute the real commands directly.

This ensures any custom scripting in place during Codespaces build process will work as expected. This feature can only be used at Codespaces runtime as it requires user interaction.

## Authentication Helper Wait Behavior

The shim scripts (e.g., `dotnet`, `npm`, `nuget`) now include a wait mechanism for the Azure DevOps authentication helper. When invoked, these scripts will:
Expand Down Expand Up @@ -89,4 +95,4 @@ if the `targetFiles` option is provided, so you may want to include them in the
# ~/.bashrc

source /custom/path/to/auth-helper.sh
```
```
2 changes: 1 addition & 1 deletion src/artifacts-helper/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Azure Artifacts Credential Helper",
"id": "artifacts-helper",
"version": "3.0.0",
"version": "3.0.1",
"description": "Configures Codespace to authenticate with Azure Artifact feeds",
"options": {
"nugetURIPrefixes": {
Expand Down
7 changes: 7 additions & 0 deletions src/artifacts-helper/scripts/auth-ado.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in a GitHub Actions environment
# Skip Azure DevOps authentication and just execute the real command
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
echo "::step::GitHub Actions environment detected, skipping Azure DevOps authentication"
return 0
fi

echo "::step::Waiting for AzDO Authentication Helper..."

# Wait up to 3 minutes for the ado-auth-helper to be installed
Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/dotnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
DOTNET_EXE="$(resolve_shim)"
"${DOTNET_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/npm
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
NPM_EXE="$(resolve_shim)"
"${NPM_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/npx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
NPX_EXE="$(resolve_shim)"
"${NPX_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/nuget
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
NUGET_EXE="$(resolve_shim)"
"${NUGET_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/pnpm
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
PNPM_EXE="$(resolve_shim)"
"${PNPM_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/pnpx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
PNPX_EXE="$(resolve_shim)"
"${PNPX_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/rush
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
RUSH_EXE="$(resolve_shim)"
"${RUSH_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/rush-pnpm
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
RUSH_PNPM_EXE="$(resolve_shim)"
"${RUSH_PNPM_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
9 changes: 9 additions & 0 deletions src/artifacts-helper/scripts/yarn
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash

# If ACTIONS_ID_TOKEN_REQUEST_URL is set, we're in GitHub Actions - skip Azure DevOps setup
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL}" ]; then
source "$(dirname $0)"/resolve-shim.sh
YARN_EXE="$(resolve_shim)"
"${YARN_EXE}" "$@"
exit $?
fi

source "$(dirname $0)"/auth-ado.sh
source "$(dirname $0)"/resolve-shim.sh

Expand Down
Loading