Skip to content

Commit f272b47

Browse files
authored
fix login and publish (#1440)
2 parents e57a617 + 5ecc7bf commit f272b47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/actions/cargo-publish/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ runs:
2727
${{ runner.temp }}/artifacts
2828

2929
- name: Log into crates.io
30-
if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.event_name != 'issue_comment'
31-
run: cargo login -- ${{ inputs.cargo-registry-token }}
30+
if: >
31+
github.event_name == 'push' && (
32+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) ||
33+
startsWith(github.ref, 'refs/tags/v')
34+
)
35+
run: cargo login ${{ inputs.cargo-registry-token }}
3236
shell: bash
3337

3438
- run: gh release delete --yes Unreleased || exit 0

0 commit comments

Comments
 (0)