Skip to content

Commit 68b07fc

Browse files
authored
Refactor GitHub Actions prebuild support documentation
Reorganize GitHub Actions prebuild support section for clarity and update details on shim scripts behavior.
1 parent 75afc85 commit 68b07fc

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/artifacts-helper/NOTES.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ This installs [Azure Artifacts Credential Provider](https://github.com/microsoft
22
and optionally configures shims which shadow `dotnet`, `nuget`, `npm`, `yarn`, `rush`, and `pnpm`.
33
These dynamically sets an authentication token for pulling artifacts from a feed before running the command.
44

5-
## GitHub Actions / Codespaces Prebuild Support
6-
7-
**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 prevents:
8-
9-
- Unnecessary 3-minute wait for authentication helper
10-
- Installation of credential providers that aren't needed
11-
- Setting Azure DevOps-specific environment variables
12-
13-
This ensures package restore operations work seamlessly during Codespaces prebuild without interference from the Azure Artifacts authentication mechanisms.
14-
155
For `npm`, `yarn`, `rush`, and `pnpm` this requires that your `~/.npmrc` file is configured to use the ${ARTIFACTS_ACCESSTOKEN}
166
environment variable for the `authToken`. A helper script has been added that you can use to write your `~/.npmrc`
177
file during your setup process, though there are many ways you could accomplish this. To use the script, run it like
@@ -48,6 +38,12 @@ pip install <package_name> --index-url https://pkgs.dev.azure.com/<org_name>/_pa
4838
When the feed URL is an Azure Artifacts feed pip will use the keyring helper to provide the credentials needed
4939
to download the package.
5040

41+
## GitHub Actions / Codespaces Prebuild Support
42+
43+
**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.
44+
45+
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.
46+
5147
## Authentication Helper Wait Behavior
5248

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

10197
source /custom/path/to/auth-helper.sh
102-
```
98+
```

0 commit comments

Comments
 (0)