Merge pull request #6586 from matrix-org/dbkr/pr_comment_in_workflow_run

Do the PR comment a different way
This commit is contained in:
David Baker 2021-08-10 11:40:57 +01:00 committed by GitHub
commit c1b49092f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,16 +35,24 @@ jobs:
fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data)); fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
- run: unzip previewbuild.zip && rm previewbuild.zip - run: unzip previewbuild.zip && rm previewbuild.zip
- name: Deploy to Netlify - name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v1.2 uses: nwtgck/actions-netlify@v1.2
with: with:
publish-dir: . publish-dir: .
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions" deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true # These don't work because we're in workflow_run
enable-pull-request-comment: false
enable-commit-comment: false enable-commit-comment: false
overwrites-pull-request-comment: true
env: env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1 timeout-minutes: 1
- name: Comment on PR
uses: phulsechinmay/rewritable-pr-comment@v0.3.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_ID: ${{ github.event.workflow_run.pull_requests[0].number }}
message: |
Preview: ${{ steps.netlify.deploy-url }}
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.