From c83bfbd21ce94a96f7af01ab0a82f20535f4aefb Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Wed, 10 Mar 2021 07:07:38 +0000 Subject: [PATCH] ci: enable pull_request trigger --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31d97c3..1145914 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,8 +5,10 @@ on: push: branches: '*' tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi - # TODO not sure if need 'pull_request'?? + # Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them". + pull_request: # needed to trigger on others' PRs workflow_dispatch: # needed to trigger workflows manually + # todo cron? env: # useful for scripts & sometimes tests to know @@ -65,7 +67,7 @@ jobs: - name: 'release to test pypi' # always deploy merged master to test pypi - if: github.event.ref == 'refs/heads/master' + if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master' env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }} run: pip3 install --user wheel twine && scripts/release --test @@ -74,7 +76,7 @@ jobs: - name: 'release to pypi' # always deploy tags to release pypi # NOTE: release tags are guarded by on: push: tags on the top - if: startsWith(github.event.ref, 'refs/tags') + if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: pip3 install --user wheel twine && scripts/release