Skip to content

Commit

Permalink
Fix: add versioning or latest commit information to our about page
Browse files Browse the repository at this point in the history
  • Loading branch information
ofirc77 committed Dec 23, 2024
1 parent b848690 commit d692121
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
with:
node-version: 18
cache: 'npm'
- name: Get Commit Hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Generate Version File
run: echo "export const COMMIT_HASH = '${{ env.COMMIT_HASH }}';" > src/version.js
- name: Run install
run: npm ci
- name: Build Storybook
Expand Down
6 changes: 5 additions & 1 deletion src/pages/about/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './About.scss'
import { useQuery } from '@tanstack/react-query'
import SlackIcon from '../../resources/slack-icon.svg'
import Widget from 'src/shared/Widget'
import { COMMIT_HASH } from '../../version';

Check failure on line 9 in src/pages/about/index.tsx

View workflow job for this annotation

GitHub Actions / build

Could not find a declaration file for module '../../version'. '/home/runner/work/open-bus-map-search/open-bus-map-search/src/version.js' implicitly has an 'any' type.

Check failure on line 9 in src/pages/about/index.tsx

View workflow job for this annotation

GitHub Actions / build-outside-docker

Could not find a declaration file for module '../../version'. '/home/runner/work/open-bus-map-search/open-bus-map-search/src/version.js' implicitly has an 'any' type.

Check failure on line 9 in src/pages/about/index.tsx

View workflow job for this annotation

GitHub Actions / local-tests

`../../version` import should occur before import of `src/shared/Widget`

Check failure on line 9 in src/pages/about/index.tsx

View workflow job for this annotation

GitHub Actions / local-tests

Delete `;`

const pageName = 'aboutPage'
const About = () => {
Expand Down Expand Up @@ -164,9 +165,12 @@ const Attributions = () => {
<h2>Attributions</h2>
<ul>
<li>
Thanks <a href="http://www.applitools.com/">Applitools</a> for the free open-source
Thanks <a href="http://www.applitools.com/">Applitools</a> for the free open-source.
license for their visual testing tool
</li>
<p>
Version commit hash: <strong>{COMMIT_HASH}</strong>
</p>
<li>
Bus ifmage by{' '}
<a
Expand Down
1 change: 1 addition & 0 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const COMMIT_HASH = 'test1234';

Check failure on line 1 in src/version.js

View workflow job for this annotation

GitHub Actions / local-tests

Delete `;`

0 comments on commit d692121

Please sign in to comment.