Skip to content

Commit

Permalink
On push, cancel in-progress runs EXCEPT on main
Browse files Browse the repository at this point in the history
  • Loading branch information
heerener committed Feb 23, 2024
1 parent 7044123 commit ed5f209
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/waste_time.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
on:
pull_request:
types: [opened, edited, synchronize, reopened]
push:
branches:
- main
- ci/**


concurrency:
# Don't cancel on main
group: ${{ github.workflow }}-${{ github.ref == refs/heads/main && github.run_id || github.event.pull_request_number || github.ref }}
cancel-in-progress: true


# For Draft PRs, we only want the herpaderp step 1
Expand All @@ -25,12 +35,12 @@ jobs:
if: ${{ github.event.pull_request.draft == true && matrix.config.moo == 'herpaderp' }}
run: |
echo "Doing the thing"
sleep 5
sleep 20
echo "The thing is done"
- name: Always run
run: |
echo "This thing always happens"
sleep 5
sleep 20
echo "And has now been concluded"
meowtrix:
Expand All @@ -52,10 +62,10 @@ jobs:
- name: First step
run: |
echo "Doing the thing"
sleep 5
sleep 20
echo "The thing is done"
- name: Second step
run: |
echo "Doing the other thing"
sleep 5
sleep 20
echo "The other thing is also done"

0 comments on commit ed5f209

Please sign in to comment.