From 5ecc7bfcb694886ebc1668679a9f4d9365580aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Tue, 6 Feb 2024 14:39:19 +0100 Subject: [PATCH] fix login and publish --- .github/actions/cargo-publish/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/cargo-publish/action.yml b/.github/actions/cargo-publish/action.yml index d55d1d59e..c32cb78c6 100644 --- a/.github/actions/cargo-publish/action.yml +++ b/.github/actions/cargo-publish/action.yml @@ -27,8 +27,12 @@ runs: ${{ runner.temp }}/artifacts - name: Log into crates.io - if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.event_name != 'issue_comment' - run: cargo login -- ${{ inputs.cargo-registry-token }} + if: > + github.event_name == 'push' && ( + github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || + startsWith(github.ref, 'refs/tags/v') + ) + run: cargo login ${{ inputs.cargo-registry-token }} shell: bash - run: gh release delete --yes Unreleased || exit 0