chore: remove the tag after the commit has been merged #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clean up npm pr tags on release | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
jobs: | ||
release-pr: | ||
if: github.event.pull_request.merged == true | ||
name: "Clean up npm pr tags on release" | ||
runs-on: ubuntu-latest | ||
# comment out if:false to enable release PR to npm | ||
if: false | ||
permissions: write-all | ||
steps: | ||
- name: CI Setup | ||
uses: ./.github/actions/ci-setup | ||
- name: Ensure NPM access | ||
run: npm whoami | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Unpublish the package with the tag @pr-${{ github.event.pull_request.number }} from npm | ||
id: unpublish | ||
run: | | ||
echo ::set-output name=version::$(npm --force unpublish pr-${{ github.event.pull_request.number }}) | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |