mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
6fcc8727f5
Lately we had a few times that people pushed to their PR branch a few times to make small changes. Sadly, this triggers all CIs every time, which takes ~20 minutes. As we are limited in the amount of runners we get assigned to us, this means all other CI, even for other repositories within OpenTTD, are delayed too. We can avoid this by simply cancelling old runs when a new PR is pushed. There is a downside: sometimes people already push a new commit, but still want to know if the old one passed. That will no longer be possible with this change.
26 lines
507 B
YAML
26 lines
507 B
YAML
name: Commit checker
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
|
|
|
jobs:
|
|
commit-checker:
|
|
name: Commit checker
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 4
|
|
|
|
- name: Get pull-request commits
|
|
uses: OpenTTD/actions/checkout-pull-request@v2
|
|
|
|
- name: Check commits
|
|
uses: OpenTTD/OpenTTD-git-hooks@main
|