-
Notifications
You must be signed in to change notification settings - Fork 351
30 lines (28 loc) · 1.02 KB
/
trigger-os-merge.yml
File metadata and controls
30 lines (28 loc) · 1.02 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
name: Trigger OS merge action in TTI repo
on:
pull_request:
branches:
- 'v3.*'
types:
- closed
jobs:
trigger_merge:
name: Trigger OS merge action in TTI repo
if: ${{ github.repository == 'TheThingsNetwork/lorawan-stack' && github.event.pull_request.merged == true }}
runs-on: ubuntu-24.04
steps:
- name: Trigger OS merge action in TTI repo
uses: actions/github-script@v9
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const resp = await github.rest.repos.createDispatchEvent({
owner: 'TheThingsIndustries',
repo: 'lorawan-stack',
event_type: 'merge-os-to-enterprise',
client_payload: { ttn_pr_number: ${{ github.event.pull_request.number }} }
});
if (resp.status !== 204) {
throw new Error(`Failed to trigger OS merge action: ${resp.status} ${resp.statusText}`);
}
console.log('Triggered OS merge action in TTI repo');