From beacd1148f44a058d2c55e5b6c738932f72a41d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Szu=C5=82a?=
Date: Wed, 3 Jan 2024 00:34:21 +0100
Subject: [PATCH] Commit ref fix
---
.github/workflows/build-and-deploy.yml | 2 +-
src/lib/components/Footer.svelte | 4 +++-
vite.config.ts | 11 +++++------
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml
index 306f303..2966415 100644
--- a/.github/workflows/build-and-deploy.yml
+++ b/.github/workflows/build-and-deploy.yml
@@ -24,7 +24,7 @@ jobs:
run: npm ci
- name: Build
env:
- COMMIT_HASH: ${{ toJson(github.sha) }}
+ VITE_GIT_COMMIT_REF: ${GITHUB_SHA::7}
run: npm run gh-pages-build
- name: Setup Pages
uses: actions/configure-pages@v3
diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte
index 96c7e4e..33355a3 100644
--- a/src/lib/components/Footer.svelte
+++ b/src/lib/components/Footer.svelte
@@ -7,7 +7,9 @@
target="_blank">mszula
using Svelte.
- Version: {window.__COMMIT_HASH__}
+ Version: {import.meta.env.VITE_GIT_COMMIT_REF}