From e9a094846e136a5f201debb08c63eb641db66307 Mon Sep 17 00:00:00 2001 From: ocavue Date: Sat, 27 Jul 2024 23:18:52 +1000 Subject: [PATCH] ci: check npm token before publishing --- .github/workflows/release.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16356de..ff8ae9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: publish: runs-on: ubuntu-latest needs: [version] - if: ${{ needs.version.outputs.release_created }} + # if: ${{ needs.version.outputs.release_created }} steps: - uses: actions/checkout@v4 @@ -28,6 +28,17 @@ jobs: - name: Build run: yarn run build + - name: Check NPM_TOKEN + run: | + if [ -z "$NPM_TOKEN" ]; then + echo "NPM_TOKEN is not set" + exit 1 + else + echo "NPM_TOKEN is set" + fi + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish to NPM run: yarn publish env: