From 087bab80065c00285e1ed0f218ee79a4ff4988fd Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Thu, 20 Jun 2024 13:20:38 +1000 Subject: [PATCH] chore: try replacing all checkout events... just because --- .github/workflows/pipeline.yml | 64 ++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 1b6b67f..ffac295 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -30,7 +30,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 + - name: Use Node.js 20 uses: actions/setup-node@v4 with: @@ -50,7 +59,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 + - name: Use Node.js 20 uses: actions/setup-node@v4 with: @@ -70,7 +88,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 - name: Use Node.js 20 uses: actions/setup-node@v4 @@ -98,7 +124,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 - name: Use Node.js 20 uses: actions/setup-node@v4 @@ -123,7 +157,7 @@ jobs: steps: - name: Checkout using PR head - if: ${{ needs.check-permissions.outputs.checkout-priv == 'true' }} + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} @@ -227,7 +261,15 @@ jobs: needs: compile steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 - name: Use Node.js 20 uses: actions/setup-node@v4 @@ -318,7 +360,15 @@ jobs: needs: compile runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout using PR head if sufficent permissions + if: ${{ github.event_name == 'pull_request' && needs.check-permissions.outputs.checkout-priv == 'true'}} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + if: ${{ needs.check-permissions.outputs.checkout-priv == 'false' }} + uses: actions/checkout@v4 - name: Use Node.js 20 uses: actions/setup-node@v4