Skip to content

Commit

Permalink
fix: Commit hash missing in nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-treason committed Sep 8, 2024
1 parent 881941b commit 9458c2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get short SHA
id: slug
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Fetch dependencies
run: |
npm i -g pnpm
pnpm i
- name: Make
env:
COMMIT_SHORT_SHA: ${{ steps.slug.outputs.SHORT_SHA }}
run: |
pnpm run make
Expand All @@ -79,11 +85,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get short SHA
id: slug
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Fetch dependencies
run: |
npm i -g pnpm
pnpm i
- name: Make
env:
COMMIT_SHORT_SHA: ${{ steps.slug.outputs.SHORT_SHA }}
run: |
pnpm run make
Expand All @@ -106,11 +118,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get short SHA
id: slug
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Fetch dependencies
run: |
npm i -g pnpm
pnpm i
- name: Make
env:
COMMIT_SHORT_SHA: ${{ steps.slug.outputs.SHORT_SHA }}
run: |
pnpm run make
ls ./packages/bruno-electron/out/
Expand Down
4 changes: 2 additions & 2 deletions packages/bruno-electron/vite.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const external = [
// Get the latest commit hash
const getLatestCommitHash = () => {
try {
return execSync('git rev-parse --short HEAD').toString().trim();
return process.env.COMMIT_SHORT_SHA || execSync('git rev-parse --short HEAD').toString().trim();
} catch (error) {
console.error('Failed to get git commit hash:', error);
console.warn('Failed to get git commit hash', error);
return 'Unknown';
}
};
Expand Down

0 comments on commit 9458c2e

Please sign in to comment.