Skip to content

Commit 0bd7fe7

Browse files
authored
Update cve_checks.yml with SHORT_SHA
1 parent b4ffd96 commit 0bd7fe7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/cve_checks.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ jobs:
2323
java-version: '17'
2424
distribution: 'zulu'
2525
cache: 'maven'
26+
- name: Set short commit sha
27+
id: variables
28+
run: |
29+
calculatedSha=$(git rev-parse --short ${{github.sha}})
30+
echo "SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
2631
2732
- name: Build project
2833
id: build
2934
run: |
30-
./mvnw -B -ntp versions:set -DnewVersion=$GITHUB_SHA
35+
./mvnw -B -ntp versions:set -DnewVersion=$SHORT_SHA
3136
./mvnw -B -V -ntp clean package -DskipTests
3237
export VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
3338
echo "version=${VERSION}" >> $GITHUB_OUTPUT
@@ -42,7 +47,7 @@ jobs:
4247
uses: actions/cache@v4
4348
with:
4449
path: /tmp/.buildx-cache
45-
key: ${{ runner.os }}-buildx-${{ github.sha }}
50+
key: ${{ runner.os }}-buildx-${{ env.SHORT_SHA }}
4651
restore-keys: |
4752
${{ runner.os }}-buildx-
4853

0 commit comments

Comments
 (0)