-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (26 loc) · 859 Bytes
/
unpublish.yml
File metadata and controls
29 lines (26 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Unpublish Package
on:
workflow_dispatch:
inputs:
version:
description: 'Version to unpublish (or "all")'
required: true
type: string
jobs:
unpublish:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
- run: |
if [ "${{ github.event.inputs.version }}" == "all" ]; then
echo "Attempting to unpublish entire package"
npm unpublish saborter --force || echo "Failed to unpublish"
else
echo "Unpublishing version ${{ github.event.inputs.version }}"
npm unpublish @saborter/server@${{ github.event.inputs.version }} || echo "Failed to unpublish"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}