diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6845cc50..54f60bd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,31 +98,31 @@ jobs: fi echo "SCREENSHOT_URL=$SCREENSHOT_URL" >> $GITHUB_ENV || true echo "SCREENSHOT_URL: ${SCREENSHOT_URL}" || true - - name: Post Screenshot URL - if: ${{ always() && github.event_name == 'pull_request' && github.run_status != 'cancelled' }} - uses: actions/github-script@v6 - with: - script: | - const prNumber = context.payload.pull_request.number; - const screenshotURL = process.env.SCREENSHOT_URL; - if (screenshotURL) { - const commentBody = `Seems like the test succeeded. Temporary screenshot URL: ${screenshotURL}`; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - body: commentBody - }); - } else { - const runURL = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}`; - const commentBody = `The test was unable to make a screenshot. Most likely, the test did not succeed. Please check the [logs of the test run](${runURL}).`; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - body: commentBody - }); - core.setFailed("Unable to post screenshot"); - } - - +# The following is disabled because it gives errors about missing permissions +# whenever a PR is made by anyone but the repo maintainer +# - name: Post Screenshot URL +# if: ${{ always() && github.event_name == 'pull_request' && github.run_status != 'cancelled' }} +# uses: actions/github-script@v6 +# with: +# script: | +# const prNumber = context.payload.pull_request.number; +# const screenshotURL = process.env.SCREENSHOT_URL; +# if (screenshotURL) { +# const commentBody = `Seems like the test succeeded. Temporary screenshot URL: ${screenshotURL}`; +# await github.rest.issues.createComment({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# issue_number: prNumber, +# body: commentBody +# }); +# } else { +# const runURL = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}`; +# const commentBody = `The test was unable to make a screenshot. Most likely, the test did not succeed. Please check the [logs of the test run](${runURL}).`; +# await github.rest.issues.createComment({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# issue_number: prNumber, +# body: commentBody +# }); +# core.setFailed("Unable to post screenshot"); +# }