Skip to content

Commit 5295bad

Browse files
committed
wip
1 parent ec6496f commit 5295bad

File tree

2 files changed

+54
-21
lines changed

2 files changed

+54
-21
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ on:
2828
version:
2929
description: The version of the firmware built on this run_id
3030
value: ${{ jobs.build.outputs.version }}
31+
ncsupdate_pr:
32+
description: Pull request id for west ncs pointer
33+
value: ${{ jobs.build.outputs.ncsupdate_pr }}
3134

3235
pull_request:
3336
paths-ignore:
@@ -47,6 +50,7 @@ jobs:
4750
outputs:
4851
run_id: ${{ github.run_id }}
4952
version: ${{ env.VERSION }}
53+
ncsupdate_pr: ${{ steps.pr.outputs.pull-request-number }}
5054
permissions:
5155
contents: write
5256
pull-requests: write
@@ -132,7 +136,7 @@ jobs:
132136
uses: ./asset-tracker-template/.github/actions/build-step
133137
with:
134138
memfault_project_key: ${{ secrets.MEMFAULT_PROJECT_KEY }}
135-
memfault_fw_type: ${{ inputs.memfault_fw_type }}
139+
memfault_fw_type: ${{ inputs.memfault_fw_type }}
136140
memfault_fw_version_prefix: ${{ env.MEMFAULT_FW_VERSION_PREFIX }}
137141
board: nrf9151dk/nrf9151/ns
138142
short_board: nrf9151dk
@@ -145,13 +149,13 @@ jobs:
145149
uses: ./asset-tracker-template/.github/actions/build-step
146150
with:
147151
memfault_project_key: ${{ secrets.MEMFAULT_PROJECT_KEY }}
148-
memfault_fw_type: ${{ inputs.memfault_fw_type }}
152+
memfault_fw_type: ${{ inputs.memfault_fw_type }}
149153
memfault_fw_version_prefix: ${{ env.MEMFAULT_FW_VERSION_PREFIX }}
150154
board: nrf9151dk/nrf9151/ns
151155
short_board: nrf9151dk
152156
version: ${{ env.VERSION }}
153157
path: asset-tracker-template/app
154-
158+
155159
- name: Upload artifacts
156160
uses: actions/upload-artifact@v4
157161
with:
@@ -163,18 +167,33 @@ jobs:
163167
echo Run id: ${{ github.run_id }}
164168
echo Version: ${{ env.VERSION }}
165169
166-
- name: Auto PR update NCS reference
170+
- name: Create update PR
167171
if: ${{ inputs.nrfsdk_sha_update }}
168-
working-directory: asset-tracker-template
172+
uses: peter-evans/create-pull-request@v7
173+
id: pr
174+
with:
175+
path: asset-tracker-template
176+
add-paths: west.yml
177+
commit-message: "manifest: auto: Update nrf-sdk SHA"
178+
branch: nrf-manifest-auto-branch
179+
base: main
180+
title: "manifest: auto: Update nrf-sdk SHA"
181+
182+
- name: Check outputs
169183
run: |
170-
git config user.name "github-actions[bot]"
171-
git config user.email "github-actions[bot]@users.noreply.github.com"
172-
git add west.yml
173-
git commit -m "manifest: auto: Update nrf-sdk SHA"
174-
git push origin HEAD:nrf-manifest-auto-branch --force
175-
gh pr create --title "manifest: auto: Update nrf-sdk SHA" \
176-
--body "Created by GitHub Action" \
177-
--base main \
178-
--head nrf-manifest-auto-branch || true
179-
env:
180-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184+
echo PR created: ${{ steps.pr.outputs.pull-request-number }}
185+
#- name: Create update PR
186+
# if: ${{ inputs.nrfsdk_sha_update }}
187+
# working-directory: asset-tracker-template
188+
# run: |
189+
# git config user.name "github-actions[bot]"
190+
# git config user.email "github-actions[bot]@users.noreply.github.com"
191+
# git add west.yml
192+
# git commit -m "manifest: auto: Update nrf-sdk SHA"
193+
# git push origin HEAD:nrf-manifest-auto-branch --force
194+
# gh pr create --title "manifest: auto: Update nrf-sdk SHA" \
195+
# --body "Created by GitHub Action" \
196+
# --base main \
197+
# --head nrf-manifest-auto-branch || true
198+
# env:
199+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ncsref-update.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,25 @@ jobs:
2828
needs: [build, test]
2929
runs-on: ubuntu-latest
3030
permissions:
31+
actions: read
32+
contents: write
33+
packages: read
3134
pull-requests: write
3235
steps:
3336
- name: Update PR state
34-
run: |
35-
PR_ID=$(gh pr list --repo ${{ github.repo }} | grep nrf-manifest-auto-branch | awk '{print $1}')
36-
gh pr review $PR_ID --approve --repo ${{ github.repo }}
37-
env:
38-
GH_TOKEN: ${{ github.token }}
37+
uses: peter-evans/create-or-update-comment@v4
38+
with:
39+
issue-number: ${{ needs.build.outputs.ncsupdate_pr }}
40+
body: |
41+
This is a multi-line test comment
42+
- With GitHub **Markdown** :sparkles:
43+
- Created by [create-or-update-comment][1]
44+
45+
[1]: https://github.com/peter-evans/create-or-update-comment
46+
reactions: "+1"
47+
48+
# run: |
49+
# PR_ID=$(gh pr list --repo ${{ github.repository }} | grep nrf-manifest-auto-branch | awk '{print $1}')
50+
# gh pr review $PR_ID --approve --repo ${{ github.repository }}
51+
# env:
52+
# GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)