-
Notifications
You must be signed in to change notification settings - Fork 263
39 lines (37 loc) · 1.39 KB
/
manifest-PR.yml
File metadata and controls
39 lines (37 loc) · 1.39 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
35
36
37
38
39
name: handle manifest PR
on:
pull_request_target:
types: [opened, synchronize, closed, reopened]
branches:
- main
- ncs-v*-branch
permissions:
contents: read
jobs:
call-manifest-pr-action:
runs-on: ubuntu-latest
outputs:
base-branch: ${{ steps.set-base-branch.outputs.base_branch }}
steps:
# Determine the base branch:
# * sdk-mcuboot/main -> sdk-nrf/main
# * sdk-mcuboot/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch
- name: Set base branch
id: set-base-branch
run: |
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "base_branch=main" >> "$GITHUB_OUTPUT"
elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then
branch_name="${{ github.event.pull_request.base.ref }}"
branch_name="${branch_name#ncs-}"
echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT"
else
echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2
exit 1
fi
- name: handle manifest PR
uses: nrfconnect/action-manifest-pr@main
with:
token: ${{ secrets.NCS_GITHUB_TOKEN }}
manifest-pr-title-details: ${{ github.event.pull_request.title }}
base-branch: ${{ steps.set-base-branch.outputs.base_branch }}