CD-teardown #864
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: CD-teardown | |
on: delete | |
env: | |
CI: true | |
jobs: | |
unpublish-npm: | |
runs-on: ubuntu-22.04 | |
if: ${{github.event.ref_type == 'branch' && github.actor != 'dependabot[bot]'}} | |
steps: | |
- name: Prepare for unpublication from npm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Determine npm tag | |
# Remove non-alphanumeric characters | |
# See https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable | |
run: echo "TAG_SLUG=$(echo "${{ github.event.ref }}" | tr -cd '[:alnum:]-')" >> $GITHUB_ENV | |
- name: Remove npm tag for the deleted branch | |
run: npm dist-tag rm @inrupt/solid-common-vocab $TAG_SLUG | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.INRUPT_NPM_TOKEN }} | |
- run: echo "Package tag \`$TAG_SLUG\` unpublished." |