Repository navigation
Remove the JFrog npm credentials at the end of each CI job that writes them - #2351
Merged
Merged
Conversation
configure-npm.sh writes the JFrog access token into ~/.npmrc and appends it to ~/.yarnrc.yml. Nothing removed them, so on a reused runner the token would outlive its job and ~/.yarnrc.yml would keep growing. Each job that runs the script now ends with an `if: always()` step that removes both files. Yarn reads its user config only from the home folder (YARN_RC_FILENAME is a file name joined to each directory, and it renames the project's .yarnrc.yml too), so moving the config to $RUNNER_TEMP is not possible. Co-authored-by: Isaac <no-reply@databricks.com>
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 13:35 — with
GitHub Actions
Inactive
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 13:36 — with
GitHub Actions
Inactive
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 13:37 — with
GitHub Actions
Inactive
Contributor
|
🤖 Integration tests ❌ failed for |
anton-107
marked this pull request as ready for review
November 24, 2026 15:51
louis-johnston-db
approved these changes
Nov 24, 2026
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 18:32 — with
GitHub Actions
Inactive
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 20:11 — with
GitHub Actions
Inactive
anton-107
temporarily deployed
to
test-trigger-is
November 24, 2026 21:01 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
configure-npm.shwrites the JFrog access token into~/.npmrcand appends it to~/.yarnrc.yml. Nothing removed those files. If a runner were reused, the token would outlive its job (and be readable by later jobs from other refs), and~/.yarnrc.ymlwould grow by one block per job. This follows #2291 and #2334, which mask the JFrog token in the logs.Changes
Every job that runs
configure-npm.shnow ends with anif: always()step that runsrm -f ~/.npmrc ~/.yarnrc.yml, so the files go away when the job fails or is cancelled too. On main that covers push.yml, unit-tests.yml (Linux and Windows), create-build-artifacts.yml and release-pr.yml. The script's header notes that its callers need this step.I did not move the config to
$RUNNER_TEMP. npm would honourNPM_CONFIG_USERCONFIG, but Yarn Berry can't be pointed at another file. In the vendored Yarn (3.2.1 on main, 4.18.1 on release/3.x), the user config isjoin(os.homedir(), rcFilename).YARN_RC_FILENAMEis only a file name joined to each directory, and setting it would also make Yarn skip the repository's own.yarnrc.yml(yarnPath, plugins,nodeLinker). The cleanup step is inline rather than a script so it still runs when checkout fails.Are the runners ephemeral?
Probably yes, but this is strong circumstantial evidence, not a documented guarantee:
databricks-protected-runner-group. Each had a different runner name (linux-ubuntu-latest-1002083886,…887,windows-server-latest-1002200933, …), with a counter that only goes up and no name used twice. That is the naming GitHub uses for its hosted larger runners, which get a new VM for every job.ubuntu-22-04-crowdstrike-image. That means a GitHub-hosted runner with a custom image, not a self-hosted runner.The cleanup does not depend on the answer. It protects against a runner being reused, or the group changing later, at the cost of one
rmper job.Tests
shellcheck .github/scripts/*.sh .github/scripts/tests/*.shpasses.bash .github/scripts/tests/secret-masking.shpasses.configure-npm.shtwice with a fake token in a temporaryHOME..yarnrc.ymlthen held twonpmRegistryServerblocks, which shows the growth. Running the cleanup command removed both files.This pull request and its description were written by Isaac.