From 386db8f38599aad32472ad631a4635b926e3189a Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Dec 2025 19:37:48 +0000 Subject: [PATCH] Fix the topic update workflow (#31416) * Fix the topic update workflow * Update room IDs with the new ones after upgrades * Make room name variable more descriptive * Fail if the topic doesn't match * Return when failing --- .github/workflows/update-topics.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-topics.yaml b/.github/workflows/update-topics.yaml index 85b9632b45..563d4eaa03 100644 --- a/.github/workflows/update-topics.yaml +++ b/.github/workflows/update-topics.yaml @@ -26,13 +26,13 @@ jobs: env: HS_URL: ${{ secrets.BETABOT_HS_URL }} LOBBY_ROOM_ID: ${{ secrets.ROOM_ID }} - PUBLIC_ROOM_ID: "!IemiTbwVankHTFiEoh:matrix.org" - ANNOUNCEMENT_ROOM_ID: "!bijaLdadorKgNGtHdA:matrix.org" + PUBLIC_DISCUSSION_ROOM_ID: "!xUW4PpAe1CmThA3r2wI8IrgwwsK006-zqWdJCljpd10" + ANNOUNCEMENT_ROOM_ID: "!ars5ndgI6IIYZXECiJ-u8YljHNzShJn3nHdB-3rYI2M" TOKEN: ${{ secrets.BETABOT_ACCESS_TOKEN }} RELEASE_STATUS: "Release status: ${{ inputs.expected_status }} expected ${{ inputs.expected_date }}" with: script: | - const { HS_URL, TOKEN, RELEASE_STATUS, LOBBY_ROOM_ID, PUBLIC_ROOM_ID, ANNOUNCEMENT_ROOM_ID } = process.env; + const { HS_URL, TOKEN, RELEASE_STATUS, LOBBY_ROOM_ID, PUBLIC_DISCUSSION_ROOM_ID, ANNOUNCEMENT_ROOM_ID } = process.env; const repo = context.repo; const { data } = await github.rest.repos.getLatestRelease({ @@ -71,6 +71,11 @@ jobs: const data = await res.json(); console.log(roomId, "got event", data); + if (!regex.test(data.topic)) { + core.setFailed("Topic format is incorrect for room " + roomId); + return; + } + const topic = data.topic.replace(regex, releaseTopic); if (topic === data.topic) { console.log(roomId, "nothing to do"); @@ -104,5 +109,5 @@ jobs: } await updateReleaseInTopic(LOBBY_ROOM_ID); - await updateReleaseInTopic(PUBLIC_ROOM_ID); + await updateReleaseInTopic(PUBLIC_DISCUSSION_ROOM_ID); await updateReleaseInTopic(ANNOUNCEMENT_ROOM_ID);