From a254a342d124b04726e2289ba4778706c2c306ca Mon Sep 17 00:00:00 2001 From: K-Res Date: Sun, 28 Jan 2024 14:51:54 +0800 Subject: [PATCH] Test commit hash script --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b0909aa..9d6a7bc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -62,9 +62,9 @@ jobs: # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: | - echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" - echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV" - cmake -B ${{github.workspace}}/build -DPVE_DDNS_CLIENT_VER="0.0.4_${{env.sha_short}}_${{env.branch}}" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + cmake -B ${{github.workspace}}/build -DPVE_DDNS_CLIENT_VER="0.0.4_${{env.COMMIT_SHORT_SHA}}" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build # Build your program with the given configuration