Skip to content

refactor: 重构 util #10

refactor: 重构 util

refactor: 重构 util #10

Workflow file for this run

name: preview
on:
pull_request:
types:
- opened
- synchronize # Trigger on every push to the PR
jobs:
preview:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}" > ~/.npmrc
- run: |
PR_NUMBER=${{ github.event.number }}
COMMIT_SHA=${{ github.sha }}
npm version 0.0.0-preview-PR${PR_NUMBER}-${COMMIT_SHA::7} --no-git-tag-version
- run: npm publish --tag preview-${{ github.event.number }} --access public