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