Skip to content

Commit 7c7180b

Browse files
committed
[nrf noup] Add github workflow for auto manifest PR
This can be very useful for this repo as well so lets enable it. Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
1 parent eb5d3e5 commit 7c7180b

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/manifest-PR.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: handle manifest PR
2+
on:
3+
pull_request_target:
4+
types: [opened, synchronize, closed, reopened]
5+
branches:
6+
- main
7+
- ncs-v*-branch
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
call-manifest-pr-action:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
base-branch: ${{ steps.set-base-branch.outputs.base_branch }}
17+
steps:
18+
# Determine the base branch:
19+
# * sdk-zephyr/main -> sdk-nrf/main
20+
# * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch
21+
- name: Set base branch
22+
id: set-base-branch
23+
run: |
24+
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
25+
echo "base_branch=main" >> "$GITHUB_OUTPUT"
26+
elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then
27+
branch_name="${{ github.event.pull_request.base.ref }}"
28+
branch_name="${branch_name#ncs-}"
29+
echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2
32+
exit 1
33+
fi
34+
- name: handle manifest PR
35+
uses: nrfconnect/action-manifest-pr@main
36+
with:
37+
token: ${{ secrets.NCS_GITHUB_TOKEN }}
38+
manifest-pr-title-details: ${{ github.event.pull_request.title }}
39+
base-branch: ${{ steps.set-base-branch.outputs.base_branch }}

0 commit comments

Comments
 (0)