Skip to content

Also mask JFrog token in configure-npm.sh and add a regression test for CI secret masking - #2334

Merged
abdelrahmanomar1515 merged 3 commits into
mainfrom
port-2315-to-main
Nov 20, 2026
Merged

abdelrahmanomar1515 merged 3 commits into
mainfrom
port-2315-to-main

Conversation

@rclarey

@rclarey rclarey commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Changes

Port of #2315 (release/3.x) to main. It is a follow-up to #2291. The three credential scripts are identical on main and release/3.x, so both commits cherry-picked without conflicts.

  • configure-npm.sh masks the token itself. It writes JFROG_ACCESS_TOKEN into ~/.npmrc and ~/.yarnrc.yml but relied on jfrog-oidc-token.sh having masked it earlier in the same job. It now calls ::add-mask:: itself, the same way configure-pip.sh does. Every current caller already runs jfrog-oidc-token.sh first, so this does not change behavior.
  • New regression test, .github/scripts/tests/secret-masking.sh. It runs jfrog-oidc-token.sh, configure-npm.sh and configure-pip.sh as steps of a simulated job, with a stubbed curl and fake tokens. A DEBUG/EXIT trap checks, before every command, that any secret already written to GITHUB_ENV, GITHUB_OUTPUT, ~/.npmrc or ~/.yarnrc.yml has an ::add-mask:: line earlier in the job log. Values built from the token, such as PIP_INDEX_URL, are checked as whole values. Control scripts confirm that the checker flags a missing mask, a mask placed after the export, and an unmasked derived value.
  • New workflow, secret-masking-test.yml. It runs the test on pull requests with contents: read, no secrets, and persist-credentials: false.

The only difference from #2315 is whitespace: the workflow is indented with two spaces, as .github/.prettierrc.yml and the other workflows on main are. The parsed YAML is identical to the release/3.x file.

Tests

  • bash .github/scripts/tests/secret-masking.sh passes on this branch.
  • Checked locally, against the scripts on main, that the test fails if the token mask is removed from jfrog-oidc-token.sh, if that mask is moved after the GITHUB_ENV write, or if the PIP_INDEX_URL mask is removed from configure-pip.sh.
  • The new workflow on this PR is its first run on main.

This pull request and its description were written by Isaac.

rclarey and others added 3 commits November 20, 2026 10:26
configure-npm.sh writes JFROG_ACCESS_TOKEN verbatim into ~/.npmrc and
~/.yarnrc.yml. It did not mask the value itself, so it relied on
jfrog-oidc-token.sh having run first in the same job. Add the same
::add-mask:: call configure-pip.sh uses so the script is self-contained.

Co-authored-by: Isaac <no-reply@databricks.com>
The JFrog credential scripts must emit ::add-mask:: for each secret before
the value reaches GITHUB_ENV, GITHUB_OUTPUT or an rc file, or the value
ends up in public Actions logs (see b4cec4e).

Add a hermetic bash test that runs jfrog-oidc-token.sh, configure-npm.sh
and configure-pip.sh as steps of one job, with a stubbed curl and fake
credentials. A DEBUG/EXIT trap loaded via BASH_ENV checks, before every
command, that each secret already in a sink has a matching mask line
earlier in the job log. This also catches a mask that is moved after the
export. Control scripts confirm the checker flags unmasked, late-masked
and unmasked-derived values, and accepts a correct one.

Run it on pull requests from a new workflow with contents: read and no
secrets.

Co-authored-by: Isaac <no-reply@databricks.com>
The workflow was written on release/3.x, which indents .github YAML with
four spaces. On main, .github/.prettierrc.yml sets tabWidth 2 and every
other workflow follows it. Whitespace only.

Co-authored-by: Isaac <no-reply@databricks.com>
@rclarey
rclarey deployed to test-trigger-is November 20, 2026 10:29 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2334
  • Commit SHA: eac8970544bcc457ddba12fe4ff022b3287c13b4

Checks will be approved automatically on success.

@rclarey
rclarey deployed to test-trigger-is November 20, 2026 10:31 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 20, 2026 10:33 — with GitHub Actions Active
@rugpanov

rugpanov commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for eac89705.
View run

@rclarey
rclarey marked this pull request as ready for review November 20, 2026 10:58
@abdelrahmanomar1515
abdelrahmanomar1515 merged commit fff011f into main Nov 20, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
test-trigger-is — eac89705 Deployed Nov 20, 2026 by rclarey via Trigger Tests #2583
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.

3 participants