Skip to content

Commit

Permalink
Avoid running the workflow twice on PR pushes (aio-libs#700)
Browse files Browse the repository at this point in the history
When someone force-pushes to a PR or adds a new commit, the workflow would run
_twice_, as both `push` and `pull_request` events would trigger.

The default for `types` is `[opened, reopened, synchronize]`; the latter is the
type that overlaps with `push`.

In addition, existing runs for the same PR are cancelled whenever a push is made.
  • Loading branch information
mjpieters authored and q0w committed Mar 29, 2022
1 parent 26dd825 commit 4a80520
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ on:
branches:
- master
- ?.?*
types: [opened, reopened]
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build


concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true


jobs:

lint:
Expand Down
1 change: 1 addition & 0 deletions CHANGES/700.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated the GitHub workflow to avoid running unnecessary extra jobs.

0 comments on commit 4a80520

Please sign in to comment.