-
Notifications
You must be signed in to change notification settings - Fork 26
43 lines (38 loc) · 1.27 KB
/
on-pr_nrf_manifest_update_PR.yml
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
40
41
42
43
name: handle manifest PR
on:
pull_request_target:
types: [opened, synchronize, closed]
branches:
- main
jobs:
create-manifest-pr:
runs-on: ubuntu-latest
steps:
- name: Print Github context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Read body of PR
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{github.repository}}/pulls/${{github.event.number}} --jq '.body' > pr_body.md
- name: Parse body
id: config
shell: bash {0}
run: |
cat pr_body.md
grep -oP "(manifest-pr-skip)" pr_body.md
if [ $? != 0 ]; then
echo "manifest-pr-skip=false" >> $GITHUB_OUTPUT;
else
echo "manifest-pr-skip=true" >> $GITHUB_OUTPUT;
fi;
- name: show skip result
run: |
echo "steps.config.outputs.manifest-pr-skip = ${{steps.config.outputs.manifest-pr-skip}}"
- name: Create manifest PR
if: ${{ ! fromJson(steps.config.outputs.manifest-pr-skip) }}
uses: nrfconnect/action-manifest-pr@main
with:
token: ${{ secrets.NCS_GITHUB_TOKEN }}