Skip to content

Commit a669912

Browse files
authored
fix: only install cargo-bump if it hasn't been installed previously (#72)
* fix: only install cargo-bump if it hasn't been installed previously * Update action.yml * Update action.yml * Update action.yml
1 parent 247b6d8 commit a669912

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ runs:
3939
toolchain: stable
4040
override: true
4141
- uses: actions/cache@v4
42+
id: cache-cargo-bump
4243
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
4344
with:
4445
path: |
@@ -47,12 +48,17 @@ runs:
4748
~/.cargo/registry/cache/
4849
~/.cargo/git/db/
4950
key: ${{ runner.os }}-cargo-cargo-bump
51+
52+
- name: Install cargo-bump
53+
shell: bash
54+
if: steps.cache-cargo-bump.outputs.cache-hit != 'true' && (steps.semver-diff.outputs.release_type != '' || inputs.release_type != '')
55+
run: cargo install cargo-bump
56+
5057
- name: Bump Cargo.toml version
5158
shell: bash
5259
if: steps.semver-diff.outputs.release_type != '' || inputs.release_type != ''
5360
working-directory: ${{ inputs.working-directory }}
5461
run: |
55-
cargo install cargo-bump
5662
if [[ -z "${{ inputs.release_type }}" ]]; then
5763
cargo bump ${{ steps.semver-diff.outputs.release_type }}
5864
else

0 commit comments

Comments
 (0)