From 3458ff97160492d8cfbdb14247604625ce962809 Mon Sep 17 00:00:00 2001 From: fkwp Date: Thu, 11 Apr 2024 11:39:17 +0200 Subject: [PATCH] use pull_request event rather than workflow_run (#2308) * use pull_request event rather than workflow_run * use default for enable-pull-request-comment and enable-commit-comment --- .github/workflows/netlify-pr.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/netlify-pr.yaml b/.github/workflows/netlify-pr.yaml index badd0dd4..dbeb25fb 100644 --- a/.github/workflows/netlify-pr.yaml +++ b/.github/workflows/netlify-pr.yaml @@ -28,7 +28,7 @@ jobs: step: start token: ${{ secrets.GITHUB_TOKEN }} env: Netlify - ref: ${{ github.event.workflow_run.head_sha }} + ref: ${{ github.ref || github.head_ref }} desc: | Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts. @@ -36,8 +36,8 @@ jobs: - id: prdetails uses: matrix-org/pr-details-action@v1.3 with: - owner: ${{ github.event.workflow_run.head_repository.owner.login }} - branch: ${{ github.event.workflow_run.head_branch }} + owner: ${{ github.event.pull_request.head.repo.owner.login }} + branch: ${{ github.event.pull_request.head.ref }} - name: 📥 Download artifact uses: actions/download-artifact@v4 @@ -50,7 +50,7 @@ jobs: run: curl -s https://raw.githubusercontent.com/element-hq/element-call/main/config/netlify_redirects > webapp/_redirects - name: Add config file - run: curl -s "https://raw.githubusercontent.com/${{ github.event.workflow_run.head_repository.full_name }}/${{ github.event.workflow_run.head_branch }}/config/element_io_preview.json" > webapp/config.json + run: curl -s "https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}/config/element_io_preview.json" > webapp/config.json - name: ☁️ Deploy to Netlify id: netlify @@ -58,9 +58,6 @@ jobs: with: publish-dir: webapp deploy-message: "Deploy from GitHub Actions" - # These don't work because we're in workflow_run - enable-pull-request-comment: false - enable-commit-comment: false alias: pr${{ steps.prdetails.outputs.pr_id }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}