From 2fb25e3be6a6a8e9ba13a8d1c736d5d8180dab1e Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Thu, 22 Aug 2024 11:15:54 -0500 Subject: [PATCH] Only publish on crates.io if the workflow event is called `'Release'` --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 352199d7d7..7333d62aff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,5 @@ # This is triggered after the Release workflow successfully completes its run +name: Publish on crates.io on: workflow_run: workflows: @@ -10,8 +11,10 @@ env: jobs: cargo-publish: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.workflow.name == 'Release') }} steps: + - name: Print workflow event name + run: echo "${{ github.event.workflow.name }}" - name: Checkout sources uses: actions/checkout@v4 - name: Install stable toolchain