From 2f3308481f0e93c6b780c087a7fe19b01ae968d2 Mon Sep 17 00:00:00 2001 From: Demian Parkhomenko <95881717+DemianParkhomenko@users.noreply.github.com> Date: Tue, 11 Jun 2024 20:08:40 +0300 Subject: [PATCH] Fix the publish workflow to run on pull requests --- .github/workflows/publish.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5f163c1..ddccc7e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,8 +2,9 @@ name: Publish NPM package on: push: - branches: - - main + branches: [main] + pull_request: + branches: [main] env: CLOUDAMQP_API_KEY: ${{ secrets.CLOUDAMQP_API_KEY }} @@ -21,5 +22,6 @@ jobs: - run: npm run build - run: npm test - uses: JS-DevTools/npm-publish@v1 + if: ${{ github.ref == 'refs/heads/main' }} with: token: ${{ env.NPM_TOKEN }}