Skip to content

Commit

Permalink
CI: automatically create PR in NRF
Browse files Browse the repository at this point in the history
if configured, creation of PR in Sidewalk will trigger new PR in NRF.
PR in NRF will keep track the state of the PR in Sidewalk.

Remember to delete the PR in NRF if the PR gets closed without merging.

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Apr 8, 2024
1 parent 78c79e7 commit fed2f4d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## CI parameters

(branch, hash, pull/XXX/head)
NRF_revision=main

(true, false)
Create_NRF_PR=false

## Description

JIRA ticket:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/on-pr_nrf_manifest_update_PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: handle manifest PR
on:
pull_request_target:
types: [opened, synchronize, closed]
branches:
- main

jobs:
create-manifest-pr:
runs-on: ubuntu-latest
steps:
- name: Read body of PR
run: printf "%s\n" "${{ github.event.pull_request.body }}" > pr_body.md

- name: Get nrf revision
id: config
shell: bash {0}
run: |
grep -oP "(Create_NRF_PR=)(true|false)" pr_body.md > config
if [ $? != 0 ]; then
echo "Create_NRF_PR=false" >> $GITHUB_OUTPUT;
else
cat config >> $GITHUB_OUTPUT;
fi;
- name: Create manifest PR
if: ${{steps.config.outcome.Create_NRF_PR == 'true' }}
uses: nrfconnect/action-manifest-pr@main
with:
token: ${{ secrets.NCS_GITHUB_TOKEN }}

0 comments on commit fed2f4d

Please sign in to comment.