From e608276b1534dc0d34ee53367f5ed53131a3759b Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Wed, 15 Jan 2025 16:58:28 +0000 Subject: [PATCH] Do not run report action on forks to avoid permissions issues --- .github/workflows/build.yml | 4 +++- .github/workflows/pip.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eb616c24d..c167302c72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,7 +109,9 @@ jobs: timeout-minutes: 120 - name: Publish Test Report uses: mikepenz/action-junit-report@v5.0.0-a02 - if: ${{ always() && ( github.ref != 'refs/heads/master') }} + # To avoid permissions issues do not run with forked repos + # (see https://github.com/mikepenz/action-junit-report/issues/23) + if: ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }} with: report_paths: '/__w/firedrake/firedrake/firedrake.xml' comment: true diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 868c71cf9c..00595e8821 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -96,7 +96,9 @@ jobs: - name: Publish Test Report uses: mikepenz/action-junit-report@v5.0.0-a02 - if: ${{ always() && ( github.ref != 'refs/heads/master') }} + # To avoid permissions issues do not run with forked repos + # (see https://github.com/mikepenz/action-junit-report/issues/23) + if: ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }} with: report_paths: '/home/firedrake/pip_venv/src/firedrake/firedrake.xml' comment: true