Skip to content

Commit c8ce912

Browse files
authored
Release 13.2.3 (#159)
* chore: prepare next dev release * feat: make GIT_BRANCH and GIT_COMMIT_HASH available as env variables (#153) Closes *list issues numbers here* ### Developer Checklist (Definition of Done) **Issue** - [ ] All acceptance criteria from the issue are met - [ ] Tested in latest Chrome/Firefox **UI/UX/Vis** - [ ] Requires UI/UX/Vis review - [ ] Reviewer(s) are notified (_tag assignees_) - [ ] Review has occurred (_link to notes_) - [ ] Feedback is included in this PR - [ ] Reviewer(s) approve of concept and design **Code** - [ ] Branch is up-to-date with the branch to be merged with, i.e., develop - [ ] Code is cleaned up and formatted - [ ] Unit tests are written (frontend/backend if applicable) - [ ] Integration tests are written (if applicable) **PR** - [ ] Descriptive title for this pull request is provided (will be used for release notes later) - [ ] Reviewer and assignees are defined - [ ] Add type label (e.g., *bug*, *feature*) to this pull request - [ ] Add release label (e.g., `release: minor`) to this PR following [semver](https://semver.org/) - [ ] The PR is connected to the corresponding issue (via `Closes #...`) - [ ] [Summary of changes](#summary-of-changes) is written ### Summary of changes - Requires datavisyn/github-workflows#219 - Makes GIT_BRANCH and GIT_COMMIT available if they are set in the environment ### Screenshots ### Additional notes for the reviewer(s) - Thanks for creating this pull request 🤗 * Prepare release version 13.2.3 --------- Co-authored-by: datavisyn-bot <> Co-authored-by: Michael Pühringer <[email protected]>
2 parents 555a59e + f975ee4 commit c8ce912

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

config/rspack.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* eslint-disable import/no-dynamic-require */
33
const path = require('path');
44
const fs = require('fs');
5+
const { execSync } = require('child_process');
56
const { defineConfig } = require('@rspack/cli');
67
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
78
const dotenv = require('dotenv');
@@ -30,6 +31,20 @@ module.exports = (webpackEnv, argv) => {
3031
throw Error(`Invalid mode passed: ${mode}`);
3132
}
3233

34+
// Extract the git branch and commit from environment variables or git commands
35+
let gitBranch = env.GIT_BRANCH;
36+
let gitCommitHash = env.GIT_COMMIT_HASH;
37+
try {
38+
if (!gitBranch) {
39+
gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
40+
}
41+
if (!gitCommitHash) {
42+
gitCommitHash = execSync('git rev-parse --short HEAD').toString().trim();
43+
}
44+
} catch (e) {
45+
console.warn('Could not determine git branch/commit hash via git command, falling back to environment variables or undefined.');
46+
}
47+
3348
const isDevServerOnly = env.dev_server_only?.toLowerCase() === 'true';
3449
const devtool = env.devtool?.toLowerCase() === 'false' ? false : (env.devtool || (isEnvDevelopment ? 'eval-source-map' : 'source-map'));
3550
const isReactRefresh = isDevServer && isEnvDevelopment;
@@ -388,6 +403,8 @@ module.exports = (webpackEnv, argv) => {
388403
'process.env.__APP_NAME__': JSON.stringify(appPkg.name),
389404
'process.env.__APP_DISPLAY_NAME__': JSON.stringify(appPkg.displayName || appPkg.name),
390405
'process.env.__VERSION__': JSON.stringify(appPkg.version),
406+
'process.env.__GIT_BRANCH__': JSON.stringify(gitBranch),
407+
'process.env.__GIT_COMMIT_HASH__': JSON.stringify(gitCommitHash),
391408
'process.env.__LICENSE__': JSON.stringify(appPkg.license),
392409
'process.env.__BUILD_ID__': JSON.stringify(buildId),
393410
'process.env.__APP_CONTEXT__': JSON.stringify('/'),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visyn_scripts",
33
"description": "",
4-
"version": "13.2.2",
4+
"version": "13.2.3",
55
"author": {
66
"name": "datavisyn GmbH",
77
"email": "[email protected]",

0 commit comments

Comments
 (0)