Skip to content

Commit

Permalink
Add special npmrc write/delete in local directory for msal-angular (#…
Browse files Browse the repository at this point in the history
…6361)

This PR:
- Fixes an issue with the release pipeline where npm can't find the auth
token in the root of the repo since the msal-angular deploy step has the
--workspaces=false flag on by creating the npmrc directly in the
msal-angular subdirectory
  • Loading branch information
hectormmg committed Aug 18, 2023
1 parent 020856e commit 05b714f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .pipelines/custom-templates/publish-template.yml
Expand Up @@ -69,6 +69,14 @@ jobs:
# Write NPM authToken
- bash: echo $NPM_TOKEN > .npmrc
displayName: Write npm authToken
condition: not(eq('${{ parameters.libName }}', 'msal-angular'))
env:
NPM_TOKEN: $(MSALJSNPMTOKEN)
# Write NPM authToken (Angular only)
- bash: echo $NPM_TOKEN > .npmrc
displayName: Write npm authToken
workingDirectory: "${{ parameters.path }}/${{ parameters.libName }}"
condition: eq('${{ parameters.libName }}', 'msal-angular')
env:
NPM_TOKEN: $(MSALJSNPMTOKEN)

Expand Down Expand Up @@ -109,8 +117,15 @@ jobs:
# Remove .npmrc file
- task: DeleteFiles@1
displayName: Remove .npmrc file
condition: not(eq('${{ parameters.libName }}', 'msal-angular'))
inputs:
Contents: /.npmrc
# Remove .npmrc file (Angular only)
- task: DeleteFiles@1
displayName: Remove .npmrc file
condition: eq('${{ parameters.libName }}', 'msal-angular')
inputs:
Contents: ${{ parameters.path }}/${{ parameters.libName }}/.npmrc

# Install Release Scripts dependencies
- task: Npm@1
Expand Down

0 comments on commit 05b714f

Please sign in to comment.