Skip to content

Commit 4d317bb

Browse files
committed
remove commit author name for schedule event
1 parent eaf81c1 commit 4d317bb

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.github/workflows/gui-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,5 @@ jobs:
175175
CACHE_BUCKET: ${{ env.S3_PUBLIC_CACHE_BUCKET }}
176176
MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }}
177177
GITHUB_BUILD_STATUS: ${{ needs.gui-tests.result }}
178+
COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
178179
run: bash test/gui/ci/notification_template.sh .

test/gui/ci/notification_template.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ TEST_LOGS=""
1111
BRANCH_NAME="${GITHUB_REF_NAME}"
1212
ROOMID="!rnWsCVUmDHDJbiSPMM:matrix.org"
1313

14-
15-
if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
16-
COMMIT_AUTHOR="Scheduled Run ($(git log -1 --pretty=format:'%an' 2>/dev/null))"
17-
else
18-
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an' 2>/dev/null)
19-
fi
20-
2114
if [ "${GITHUB_BUILD_STATUS}" == "failure" ]; then
2215
BUILD_STATUS="❌️ Failure"
2316
fi
@@ -75,7 +68,10 @@ log_success() {
7568

7669
GITHUB_BUILD_LINK="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
7770

78-
message_html='<b>'$BUILD_STATUS'</b> <a href="'${GITHUB_BUILD_LINK}'">'${GITHUB_REPOSITORY}'#'$COMMIT_SHA_SHORT'</a> ('${BRANCH_NAME}') by <b>'${COMMIT_AUTHOR}'</b> <br> <b>'"${TEST_LOGS}"'</b>'
71+
AUTHOR_NAME=""
72+
[ "$GITHUB_EVENT_NAME" != "schedule" ] && AUTHOR_NAME=" by <b>$COMMIT_AUTHOR</b>"
73+
74+
message_html='<b>'$BUILD_STATUS'</b> <a href="'${GITHUB_BUILD_LINK}'">'${GITHUB_REPOSITORY}'#'$COMMIT_SHA_SHORT'</a> ('${BRANCH_NAME}')'${AUTHOR_NAME}' <br> <b>'"${TEST_LOGS}"'</b>'
7975
message_html=$(echo "$message_html" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
8076

8177
log_info "Sending report to the element chat..."

0 commit comments

Comments
 (0)