diff --git a/.github/scripts/webhook-pr-comment.js b/.github/scripts/webhook-pr-comment.js deleted file mode 100644 index 19c60882d..000000000 --- a/.github/scripts/webhook-pr-comment.js +++ /dev/null @@ -1,14 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -module.exports = () => { - try { - const outputsFile = fs.readFileSync('cdk-infra/outputs.json').toString(); - const outputs = JSON.parse(outputsFile); - - 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', error); - return ''; - } -}; diff --git a/.github/workflows/deploy-feature-branch.yml b/.github/workflows/deploy-feature-branch.yml index 9e7d6d150..764c90c83 100644 --- a/.github/workflows/deploy-feature-branch.yml +++ b/.github/workflows/deploy-feature-branch.yml @@ -30,17 +30,6 @@ jobs: npm run deploy:feature:stack -- -c env=stg -c customFeatureName=enhancedApp-stg-${{github.head_ref}} auto-builder-stack-enhancedApp-stg-${{github.head_ref}}-worker npm run deploy:feature:stack -- -c env=stg -c customFeatureName=enhancedApp-stg-${{github.head_ref}} auto-builder-stack-enhancedApp-stg-${{github.head_ref}}-webhooks --outputs-file outputs.json - name: Get Webhook URL - uses: actions/github-script@v6 - id: webhook - env: - GIT_BRANCH: ${{github.head_ref}} - with: - script: | - const script = require('./.github/scripts/webhook-pr-comment.js'); - return script() - result-encoding: string - - name: Comment on PR - if: steps.webhook.outputs.result != '' - run: gh pr comment ${{github.event.number}} --body "The URL for your feature branch webhook is ${{steps.webhook.outputs.result}}" + uses: mongodb/docs-worker-actions/comment-pr@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/update-feature-branch.yml b/.github/workflows/update-feature-branch.yml index cf2028fae..ba672bc28 100644 --- a/.github/workflows/update-feature-branch.yml +++ b/.github/workflows/update-feature-branch.yml @@ -47,7 +47,6 @@ jobs: npm ci npm run deploy:feature:stack -- -c env=stg -c customFeatureName=enhancedApp-stg-${{github.head_ref}} \ auto-builder-stack-enhancedApp-stg-${{github.head_ref}}-webhooks - - name: Update Worker Stack if: steps.filter.outputs.worker == 'true' run: |