From 416ba3fc2be7349238137120df4e1582d4afcd9c Mon Sep 17 00:00:00 2001 From: Itms Date: Thu, 15 May 2025 11:15:32 +0200 Subject: [PATCH] Fix Gitea actions syntax on push events The Github documentation is difficult to parse, but there is an asymmetry in the API: - for a PR event, the event object contains a `pull_request` object containing `base` and `head` objects - for a push event, the `before` and `after` SHAs are immediate children of the event object Fixes #7730. --- .gitea/workflows/checkrefs.yml | 4 ++-- .gitea/workflows/lint.yml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/checkrefs.yml b/.gitea/workflows/checkrefs.yml index 201ffc6648..d592702a0b 100644 --- a/.gitea/workflows/checkrefs.yml +++ b/.gitea/workflows/checkrefs.yml @@ -4,8 +4,8 @@ on: - push - pull_request env: - BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.push.before }} - HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.push.after }} + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.after }} jobs: lfscheck: diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 77dc6d22e6..8cd635cbc1 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -2,10 +2,11 @@ # yamllint disable rule:line-length name: lint on: + - push - pull_request env: - BASE_SHA: ${{ github.event.pull_request.base.sha }} - HEAD_SHA: ${{ github.event.pull_request.head.sha }} + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.after }} jobs: cppcheck: