File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 5050 # Disable Nightly publishing on the main branch
5151 - ${{ if endsWith(variables['Build.SourceBranchName'], '-stable') }} :
5252 - script : |
53- echo "//registry.npmjs.org/:_authToken=$(npmAuthToken)" > ~/.npmrc
53+ yarn config set npmPublishRegistry "https://registry.npmjs.org"
54+ yarn config set npmAuthToken $(npmAuthToken)
5455 node .ado/scripts/prepublish-check.mjs --verbose --tag $(publishTag)
5556 displayName: Set and validate npm auth
5657 condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))
7677 condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))
7778
7879 - script : |
79- rm -f ~/.npmrc
80- displayName: Remove npmrc if it exists
80+ # Check and unset npmAuthToken if it exists
81+ if [ "$(yarn config npmAuthToken --json | jq -r '.effective')" != "null" ]; then
82+ yarn config unset npmAuthToken
83+ fi
84+ # Check and unset npmPublishRegistry if it exists
85+ if [ "$(yarn config npmPublishRegistry --json | jq -r '.effective')" != "null" ]; then
86+ yarn config unset npmPublishRegistry
87+ fi
88+ displayName: Unset npm configuration
8189 condition: always()
You can’t perform that action at this time.
0 commit comments