mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-12 12:51:09 +01:00
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
This commit is contained in:
parent
5a9656350e
commit
386db8f385
13
.github/workflows/update-topics.yaml
vendored
13
.github/workflows/update-topics.yaml
vendored
@ -26,13 +26,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
HS_URL: ${{ secrets.BETABOT_HS_URL }}
|
HS_URL: ${{ secrets.BETABOT_HS_URL }}
|
||||||
LOBBY_ROOM_ID: ${{ secrets.ROOM_ID }}
|
LOBBY_ROOM_ID: ${{ secrets.ROOM_ID }}
|
||||||
PUBLIC_ROOM_ID: "!IemiTbwVankHTFiEoh:matrix.org"
|
PUBLIC_DISCUSSION_ROOM_ID: "!xUW4PpAe1CmThA3r2wI8IrgwwsK006-zqWdJCljpd10"
|
||||||
ANNOUNCEMENT_ROOM_ID: "!bijaLdadorKgNGtHdA:matrix.org"
|
ANNOUNCEMENT_ROOM_ID: "!ars5ndgI6IIYZXECiJ-u8YljHNzShJn3nHdB-3rYI2M"
|
||||||
TOKEN: ${{ secrets.BETABOT_ACCESS_TOKEN }}
|
TOKEN: ${{ secrets.BETABOT_ACCESS_TOKEN }}
|
||||||
RELEASE_STATUS: "Release status: ${{ inputs.expected_status }} expected ${{ inputs.expected_date }}"
|
RELEASE_STATUS: "Release status: ${{ inputs.expected_status }} expected ${{ inputs.expected_date }}"
|
||||||
with:
|
with:
|
||||||
script: |
|
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 repo = context.repo;
|
||||||
const { data } = await github.rest.repos.getLatestRelease({
|
const { data } = await github.rest.repos.getLatestRelease({
|
||||||
@ -71,6 +71,11 @@ jobs:
|
|||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
console.log(roomId, "got event", data);
|
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);
|
const topic = data.topic.replace(regex, releaseTopic);
|
||||||
if (topic === data.topic) {
|
if (topic === data.topic) {
|
||||||
console.log(roomId, "nothing to do");
|
console.log(roomId, "nothing to do");
|
||||||
@ -104,5 +109,5 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
await updateReleaseInTopic(LOBBY_ROOM_ID);
|
await updateReleaseInTopic(LOBBY_ROOM_ID);
|
||||||
await updateReleaseInTopic(PUBLIC_ROOM_ID);
|
await updateReleaseInTopic(PUBLIC_DISCUSSION_ROOM_ID);
|
||||||
await updateReleaseInTopic(ANNOUNCEMENT_ROOM_ID);
|
await updateReleaseInTopic(ANNOUNCEMENT_ROOM_ID);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user