Skip to content

Commit abcab98

Browse files
authored
Fix E2E reporting to release tracker (#6348)
1 parent 2ce5d19 commit abcab98

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
env:
6262
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
6363
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}
64+
VERSION_OR_TAG: ${{ github.event.client_payload.versionOrTag }}
6465
# run in root
6566
working-directory: '.'
6667
- name: Tests failed
@@ -69,5 +70,6 @@ jobs:
6970
env:
7071
WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }}
7172
RELEASE_TRACKER_URL: ${{ secrets.RELEASE_TRACKER_URL }}
73+
VERSION_OR_TAG: ${{ github.event.client_payload.versionOrTag }}
7274
# run in root
7375
working-directory: '.'

scripts/ci/notify-test-result.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,8 @@ async function notifyTestResults() {
3737
status = 'succeeded';
3838
}
3939

40-
let message = `E2E Tests ${status}`;
41-
let versionOrTag;
42-
43-
// Add version if it can find it in the workflow_dispatch event data.
44-
if (process.env.GITHUB_EVENT_PATH) {
45-
const wrPayload = require(process.env.GITHUB_EVENT_PATH);
46-
if (wrPayload.inputs && wrPayload.inputs.versionOrTag) {
47-
message += ` for release ${wrPayload.inputs.versionOrTag}.`;
48-
versionOrTag = wrPayload.inputs.versionOrTag;
49-
} else {
50-
console.log(`Couldn't find versionOrTag in event payload.`);
51-
}
52-
} else {
53-
console.log(`Couldn't find event payload.`);
54-
}
55-
message += ` ${workflowUrl}`;
40+
const versionOrTag = process.env.VERSION_OR_TAG;
41+
const message = `E2E Tests ${status} for release ${versionOrTag}. ${workflowUrl}`;
5642

5743
const chatPromise = new Promise((resolve, reject) => {
5844
console.log(`Sending message to chat: ${message}`);

0 commit comments

Comments
 (0)