Skip to content

Commit af79e47

Browse files
committed
fix the work flow
1 parent 4ce1880 commit af79e47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/cd.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ env:
1414

1515
jobs:
1616
build:
17+
if: >-
18+
github.event.workflow_run.conclusion == 'success' &&
19+
github.event.workflow_run.event == 'push' &&
20+
github.event.workflow_run.head_branch == 'main'
1721
runs-on: ubuntu-latest
1822
steps:
1923
- uses: actions/checkout@v4
2024
with:
21-
fetch-depth: 2
25+
fetch-depth: 0
2226

2327
- name: Set up Rust
2428
uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -35,7 +39,7 @@ jobs:
3539
- name: Get previous version from main
3640
id: previous
3741
run: |
38-
prev_ver=$(git show HEAD^:Cargo.toml | grep '^version' | head -1 | sed 's/version = "\(.*\)"/\1/')
42+
prev_ver=$(git show origin/main:Cargo.toml | grep '^version' | head -1 | sed 's/version = "\(.*\)"/\1/')
3943
echo "version=$prev_ver" >> $GITHUB_OUTPUT
4044
4145
- name: Check for version change

0 commit comments

Comments
 (0)