File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 - name : Upload build artifacts
4848 uses : actions/upload-artifact@v4
4949 with :
50- path : ./app.tar.gz
50+ name : app.tar.gz
51+ path : .
5152 retention-days : 1 # Set to 1 day for temporary storage
5253
5354 release :
6162 - name : Download build artifacts
6263 uses : actions/download-artifact@v4
6364 with :
65+ name : app.tar.gz
6466 path : ./app.tar.gz
6567
6668 - name : Create GitHub Release
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export interface ConfigLike {
1010export class ConfigHandler {
1111
1212 private static readonly configFilePath = process . env . CONFIG_FILE_PATH || './config/config.json' ;
13+ private static readonly sampleConfigFilePath = './config/config.sample.json' ;
1314
1415 private static config : ConfigLike | null = null ;
1516
@@ -23,6 +24,17 @@ export class ConfigHandler {
2324 if ( this . config ) return this . config ;
2425
2526 try {
27+
28+ if ( ! fs . existsSync ( this . configFilePath ) ) {
29+ // If config file does not exist, create it from sample
30+ if ( fs . existsSync ( this . sampleConfigFilePath ) ) {
31+ fs . copyFileSync ( this . sampleConfigFilePath , this . configFilePath ) ;
32+ } else {
33+ console . error ( "Could not find config file or sample config file." ) ;
34+ process . exit ( 1 ) ;
35+ }
36+ }
37+
2638 // Load the config from config file is not already loaded
2739 const configFile = fs . readFileSync ( this . configFilePath , 'utf-8' ) ;
2840 this . config = JSON . parse ( configFile ) as ConfigLike ;
You can’t perform that action at this time.
0 commit comments