File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9563,6 +9563,11 @@ async function run() {
95639563 let content = message;
95649564 if (!message && filePath) {
95659565 content = fs_1.default.readFileSync(filePath, 'utf8');
9566+ // exit if file is empty (and do not comment)
9567+ if (content.length === 0) {
9568+ core.info('File is empty. Exiting.');
9569+ return;
9570+ }
95669571 if (mdLanguage) {
95679572 content = `\`\`\`${mdLanguage}\n${content}\n\`\`\``;
95689573 }
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ async function run() {
2828 let content : string = message ;
2929 if ( ! message && filePath ) {
3030 content = fs . readFileSync ( filePath , 'utf8' ) ;
31+
32+ // exit if file is empty (and do not comment)
33+ if ( content . length === 0 ) {
34+ core . info ( 'File is empty. Exiting.' ) ;
35+ return ;
36+ }
37+
3138 if ( mdLanguage ) {
3239 content = `\`\`\`${ mdLanguage } \n${ content } \n\`\`\`` ;
3340 }
You can’t perform that action at this time.
0 commit comments