diff --git a/.github/workflows/npm_publish.yaml b/.github/workflows/npm_publish.yaml index c6f1c13..8d28cf1 100644 --- a/.github/workflows/npm_publish.yaml +++ b/.github/workflows/npm_publish.yaml @@ -4,6 +4,8 @@ on: pull_request: types: [ closed ] branches: [ "main" ] + # For a merge that went in without the Release label. + workflow_dispatch: permissions: id-token: write @@ -11,13 +13,15 @@ permissions: jobs: publish-npm: - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Release') + if: >- + (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || + (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Release')) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.merge_commit_sha }} + ref: ${{ github.event.pull_request.merge_commit_sha || github.sha }} - uses: actions/setup-node@v4 with: