From e786b561a22404b0769faa6dfdb983336558bb8f Mon Sep 17 00:00:00 2001 From: glx22 Date: Tue, 19 Mar 2024 17:41:05 +0100 Subject: [PATCH] Change: [CI] Update workflows --- .github/workflows/commit-checker.yml | 35 ++++++---------------------- .github/workflows/release.yml | 2 +- .github/workflows/testing.yml | 2 +- 3 files changed, 9 insertions(+), 30 deletions(-) diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml index 36df152..319ab8a 100644 --- a/.github/workflows/commit-checker.yml +++ b/.github/workflows/commit-checker.yml @@ -3,6 +3,10 @@ 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 @@ -10,37 +14,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 4 - name: Get pull-request commits - run: | - set -x - # actions/checkout did a merge checkout of the pull-request. As such, the first - # commit is the merge commit. This means that on HEAD^ is the base branch, and - # on HEAD^2 are the commits from the pull-request. We now check if those trees - # have a common parent. If not, we fetch a few more commits till we do. In result, - # the log between HEAD^ and HEAD^2 will be the commits in the pull-request. - DEPTH=4 - while [ -z "$(git merge-base HEAD^ HEAD^2)" ]; do - git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --deepen=${DEPTH} origin HEAD - DEPTH=$(( ${DEPTH} * 4 )) - done - - # Just to show which commits we are going to evaluate. - git log --oneline HEAD^..HEAD^2 - - - name: Checkout commit-checker - uses: actions/checkout@v2 - with: - repository: OpenTTD/OpenTTD-git-hooks - path: git-hooks - ref: master + uses: OpenTTD/actions/checkout-pull-request@v5 - name: Check commits - run: | - set -x - HOOKS_DIR=./git-hooks/hooks GIT_DIR=.git ./git-hooks/hooks/check-commits.sh HEAD^..HEAD^2 - echo "Commit checks passed" - + uses: OpenTTD/OpenTTD-git-hooks@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cede7cb..6f5c25d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: jobs: release: name: Release - uses: OpenTTD/actions/.github/workflows/rw-entry-release-baseset.yml@v4 + uses: OpenTTD/actions/.github/workflows/rw-entry-release-baseset.yml@v5 secrets: inherit with: apt-packages: catcodec diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 659ae22..05cd6fb 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,7 +11,7 @@ on: jobs: testing: name: Testing - uses: OpenTTD/actions/.github/workflows/rw-entry-testing-baseset.yml@v4 + uses: OpenTTD/actions/.github/workflows/rw-entry-testing-baseset.yml@v5 with: apt-packages: catcodec name: opensfx