Skip to content

Commit 0dec419

Browse files
committed
ci: checkout to the right commit
1 parent 3ef74b0 commit 0dec419

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/create-tag.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ jobs:
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v4
25-
with:
26-
ref: ${{ inputs.commit || '' }}
25+
26+
- name: Checkout to the input commit
27+
run: |
28+
if [[ -z "${{ inputs.commit }}" ]]; then
29+
COMMIT="${{ inputs.commit }}"
30+
else
31+
COMMIT=git rev-parse ${{ github.sha }}^@ | grep -Fvx ${{ github.event.pull_request.head.sha }}
32+
fi
33+
git checkout $COMMIT
2734
2835
- name: Install rust toolchain
2936
uses: dtolnay/rust-toolchain@stable

0 commit comments

Comments
 (0)