From 0dec419d43553d3a48479e4b053d65d93ac44a5f Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Sun, 8 Dec 2024 21:43:19 -0500 Subject: [PATCH] ci: checkout to the right commit --- .github/workflows/create-tag.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index 2ea41bd333..2663395c5f 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -22,8 +22,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit || '' }} + + - name: Checkout to the input commit + run: | + if [[ -z "${{ inputs.commit }}" ]]; then + COMMIT="${{ inputs.commit }}" + else + COMMIT=git rev-parse ${{ github.sha }}^@ | grep -Fvx ${{ github.event.pull_request.head.sha }} + fi + git checkout $COMMIT - name: Install rust toolchain uses: dtolnay/rust-toolchain@stable