From 94909d62abbcdfea2aab19fcf887a365fd9bc54f Mon Sep 17 00:00:00 2001 From: pkdash Date: Mon, 5 Jun 2023 18:25:53 -0400 Subject: [PATCH] [#44] run github workflow job using PR source branch --- .github/workflows/python-package.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: |