Skip to content

Commit 038c6fd

Browse files
committed
add notify e2e workflow
1 parent 1b6ccc2 commit 038c6fd

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/notify-e2e.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Notify E2E Tests
2+
3+
# Triggers the constructive-tests repo to update submodules and run E2E tests
4+
# when changes are pushed to main.
5+
6+
on:
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
trigger-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Trigger submodule update in constructive-tests
15+
uses: actions/github-script@v7
16+
with:
17+
github-token: ${{ secrets.GH_SUBMODULE_PAT }}
18+
script: |
19+
const message = context.payload.head_commit?.message || '';
20+
// Escape backticks and truncate long messages
21+
const safeMessage = message.replace(/`/g, "'").substring(0, 500);
22+
23+
await github.rest.repos.createDispatchEvent({
24+
owner: 'constructive-io',
25+
repo: 'constructive-tests',
26+
event_type: 'submodule-updated',
27+
client_payload: {
28+
repo: '${{ github.repository }}',
29+
ref: '${{ github.ref_name }}',
30+
sha: '${{ github.sha }}',
31+
commit_message: safeMessage
32+
}
33+
});
34+
console.log('Dispatched submodule-updated to constructive-tests');

0 commit comments

Comments
 (0)