Skip to content

Commit

Permalink
ci: dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi committed Feb 24, 2024
1 parent 6185929 commit 3e88c6c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ on:
permissions: {}

jobs:
set-up:
runs-on: ubuntu-latest
permissions: {}
outputs:
dry-run: ${{ fromJson(steps.set-dry-run.outputs.dry-run) }}
steps:
- id: set-dry-run
env:
DRY_RUN: ${{ github.workflow == 'publish crates' }}
run: echo "dry-run=$DRY_RUN" >> $GITHUB_OUTPUT
publish:
if: ${{ !( github.workflow == 'crates publish' && startsWith(github.event.head_commit.message, 'release:') && github.event.head_commit.author.name == 'github-actions[bot]' ) }}
needs: ["set-up"]
name: "${{ needs.set-up.outputs.dry-run && 'DRY-RUN' || '' }} publish"
runs-on: ubuntu-latest
permissions: {}
steps:
Expand All @@ -20,5 +32,5 @@ jobs:
- uses: katyo/publish-crates@33e1d18666cdfacf9f6c3547194d2c1d39cbf849 # v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
dry-run: ${{ true || github.workflow == 'publish crates' }}
dry-run: ${{ true || needs.set-up.outputs.dry-run }}
ignore-unpublished-changes: true

0 comments on commit 3e88c6c

Please sign in to comment.