From 0bd7fe7e426da65f24316deac377f1452746a64a Mon Sep 17 00:00:00 2001 From: vivekkoya <67130044+vivekkoya@users.noreply.github.com> Date: Thu, 17 Oct 2024 03:10:50 -0700 Subject: [PATCH] Update cve_checks.yml with SHORT_SHA --- .github/workflows/cve_checks.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cve_checks.yml b/.github/workflows/cve_checks.yml index 5df2d33bf..d8519dc5f 100644 --- a/.github/workflows/cve_checks.yml +++ b/.github/workflows/cve_checks.yml @@ -23,11 +23,16 @@ jobs: java-version: '17' distribution: 'zulu' cache: 'maven' + - name: Set short commit sha + id: variables + run: | + calculatedSha=$(git rev-parse --short ${{github.sha}}) + echo "SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - name: Build project id: build run: | - ./mvnw -B -ntp versions:set -DnewVersion=$GITHUB_SHA + ./mvnw -B -ntp versions:set -DnewVersion=$SHORT_SHA ./mvnw -B -V -ntp clean package -DskipTests export VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) echo "version=${VERSION}" >> $GITHUB_OUTPUT @@ -42,7 +47,7 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.SHORT_SHA }} restore-keys: | ${{ runner.os }}-buildx-