diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e8b47c2..127549b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -21,9 +21,17 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} for pull requests + if: ${{ github.event_name == 'pull_request_target' }} uses: actions/setup-python@v3 with: + ref: ${{ github.head_ref }} + python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} for push + if: ${{ github.event_name == 'push' }} + uses: actions/setup-python@v3 + with: + ref: ${{ github.ref }} python-version: ${{ matrix.python-version }} - name: Install dependencies run: |