Skip to content

Commit 52b7db1

Browse files
committed
ci: determine commit author correctly for scheduled workflow
1 parent 449e1c5 commit 52b7db1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/gui-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ jobs:
168168
steps:
169169
- name: Checkout
170170
uses: actions/checkout@v6
171+
with:
172+
fetch-depth: 1
171173

172174
- name: notify-matrix
173175
env:

test/gui/ci/notification_template.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ TEST_LOGS=""
1111
BRANCH_NAME="${GITHUB_REF_NAME}"
1212
ROOMID="!rnWsCVUmDHDJbiSPMM:matrix.org"
1313

14-
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an' 2>/dev/null)
14+
if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then
15+
git fetch origin $GITHUB_REF_NAME --depth=1 2>/dev/null || true
16+
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an' 2>/dev/null)
17+
else
18+
COMMIT_AUTHOR="${GITHUB_EVENT_HEAD_COMMIT_AUTHOR_NAME:-}"
19+
if [ -z "$COMMIT_AUTHOR" ]; then
20+
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an' 2>/dev/null)
21+
fi
22+
fi
23+
1524

1625
if [ "${GITHUB_BUILD_STATUS}" == "failure" ]; then
1726
BUILD_STATUS="❌️ Failure"

0 commit comments

Comments
 (0)