Skip to content

Commit

Permalink
Only publish on crates.io if the workflow event is called 'Release'
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Aug 22, 2024
1 parent 8c1ffda commit 2fb25e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is triggered after the Release workflow successfully completes its run
name: Publish on crates.io
on:
workflow_run:
workflows:
Expand All @@ -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
Expand Down

0 comments on commit 2fb25e3

Please sign in to comment.