Skip to content

Commit

Permalink
feat: add branch name sanitization of npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
tenequm committed Nov 9, 2023
1 parent 6158156 commit b72f27d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pre-release-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,15 @@ jobs:
- name: Publish to NPM
if: ${{ github.event.inputs.branch != '' }}
working-directory: dist/packages/types
run: |
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
npm publish --tag ${{ github.event.inputs.branch }} --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
INPUTS_BRANCH: ${{ github.event.inputs.branch }}
run: |
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
# Branch name sanitization added to avoid issues with npm version command
# Example `ci/new-branch` -> `ci-new-branch`
npm publish --tag "${INPUTS_BRANCH//\//-}" --access public
- name: Publish rc to NPM
if: ${{ github.event.inputs.branch == '' }}
Expand Down

0 comments on commit b72f27d

Please sign in to comment.