Skip to content

Commit

Permalink
Comment Preview on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 committed Jan 10, 2025
1 parent ad0cc0c commit de9a563
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- main
env:
BRANCH_NAME: ${{ github.ref_name }}
permissions:
pull-requests: write
jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -114,3 +116,15 @@ jobs:
steps:
- name: Output URL
run: echo ${{ needs.deploy.outputs.NETLIFY_PREVIEW_URL }}
- name: Comment URL Preview on PR
uses: actions/github-script@v7
env:
NETLIFY_PREVIEW_URL: ${{ needs.deploy.outputs.NETLIFY_PREVIEW_URL }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚀 Preview URL: ' + process.env.NETLIFY_PREVIEW_URL
})

0 comments on commit de9a563

Please sign in to comment.