Skip to content

Commit

Permalink
[FEATURE]: Use path.join
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Aug 31, 2023
1 parent cff1e72 commit b5a9338
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/scripts/webhook-pr-comment.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const fs = require('fs');

const path = require('path');
module.exports = () => {
try {
const outputsFile = fs.readFileSync('cdk-infra/outputs.json').toString();
const outputsFile = fs.readFileSync(path.join(process.cwd(), 'cdk-infra/outputs.json')).toString();
const outputs = JSON.parse(outputsFile);
console.log('github', github);
console.log(github.head_ref);
console.log(outputsFile);
console.log(process.env.GIT_BRANCH);
const webhook = Object.values(outputs[`auto-builder-stack-enhancedApp-stg-${process.env.GIT_BRANCH}-webhooks`])[0];
return webhook;
} catch (error) {
console.log('Error occurred when retrieving Webhook URL');
console.log('Error occurred when retrieving Webhook URL', error);
return '';
}
};

0 comments on commit b5a9338

Please sign in to comment.