From 3e88c6c1f5a3edb676502f79cc92e68ddaca7e3e Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Sun, 25 Feb 2024 08:26:23 +0900 Subject: [PATCH] ci: dry-run --- .github/workflows/publish-crates.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 9f1fd218e..2386465b3 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -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: @@ -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