diff --git a/.github/workflows/validate-new-contributor.yaml b/.github/workflows/validate-new-contributor.yaml index b6d4144d..db015e19 100644 --- a/.github/workflows/validate-new-contributor.yaml +++ b/.github/workflows/validate-new-contributor.yaml @@ -26,14 +26,19 @@ jobs: outputs: email-address: ${{ steps.output-email-address.outputs.EMAIL_ADDRESS }} steps: + - name: Set Pull Request Number + run: | + if [ "${{ github.event_name }}" == "pull_request" ] + then + echo "PR_NUM=${{ github.event.pull_request.number }}" >> $GITHUB_ENV + else + echo "PR_NUM=${{ inputs.pull-request-number }}" >> $GITHUB_ENV + fi + - name: 🛫 Checkout uses: actions/checkout@v4 - - - name: 🛫 Checkout Pull Request - if: github.event_name != 'pull_request' - run: gh pr checkout ${{ inputs.pull-request-number }} - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + with: + ref: refs/pull/${{ env.PR_NUM }}/head - uses: ocadotechnology/codeforlife-workspace/.github/actions/python/setup-environment@new_contributor_validations # TODO: use @main with: