From b92ee861dd22088d9377b6f20376d345fc9a6698 Mon Sep 17 00:00:00 2001 From: Nimish Date: Thu, 17 Oct 2024 16:30:22 +0530 Subject: [PATCH] fix: commit hash tag --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58a61839..55e5ca30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,11 +22,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set version and PR flag id: set_version run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "version=$(git rev-parse --short HEAD | cut -c 1-7)" >> $GITHUB_OUTPUT + echo "version=$(git rev-parse --short ${{ github.event.pull_request.head.sha }} | cut -c 1-7)" >> $GITHUB_OUTPUT echo "is_pr=true" >> $GITHUB_OUTPUT elif [[ "${{ github.event_name }}" == "push" ]]; then echo "version=latest" >> $GITHUB_OUTPUT