ci: move git short sha length to ENV
authorChristian Marangi <ansuelsmth@gmail.com>
Tue, 14 Nov 2023 13:47:26 +0000 (14:47 +0100)
committerPetr Štetiar <ynezz@true.cz>
Tue, 14 Nov 2023 17:25:45 +0000 (18:25 +0100)
Move git short sha length to ENV to make it easier to configure in the
future if needed.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
.github/workflows/build-push.yml

index 89d57e374ba8d8bb7cbb21c0d251afd9e6ac2d15..f4e4259b084b64da39337eae765552fa7ff6ce9f 100644 (file)
@@ -9,6 +9,7 @@ on:
 
 env:
   BUILDBOT_VERSION: 3.8.0
+  GITHUB_SHA_LEN: 8
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
@@ -63,7 +64,7 @@ jobs:
 
       - name: Environment variables
         run: |
-          echo "GIT_SHA_SHORT=${GITHUB_SHA::8}" >> $GITHUB_ENV
+          echo "GIT_SHA_SHORT=${GITHUB_SHA::${{ env.GITHUB_SHA_LEN }}}" >> $GITHUB_ENV
 
       - name: Build container and export it to local Docker
         uses: docker/build-push-action@v4