Add PR number to merge-os-to-enterprise event #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v7 | |
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', | |
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'); |