diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 367d63e..8186a28 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,8 @@ on: - main env: BRANCH_NAME: ${{ github.ref_name }} +permissions: + pull-requests: write jobs: lint: runs-on: ubuntu-latest @@ -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 + })