Skip to content

Commit 7a2957c

Browse files
committed
ci: github: Restrict permissions for actions, test update commit status
Observed issue is: Run actions/github-script@v7 (...) RequestError [HttpError]: Resource not accessible by integration (...) status: 403, response: { (...) request: { method: 'POST', url: 'https://api.github.com/repos/SiliconLabsSoftware/z-wave-protocol-controller/statuses/***', (...) This is caused by the repo configuration (in actions): "Workflow permissions" : "Read repository contents and packages permissions" Which is more restrictive that default: "Workflow permissions" : "Read and write permissions" There is no need to set perm in token anymore. Extra note, to some extends tokens may be replaced with GH apps. Origin: SiliconLabsSoftware#105 Relate-to: https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status Relate-to:SiliconLabsSoftware#67 Relate-to: https://github.com/SiliconLabsSoftware/z-wave-protocol-controller/settings/actions Signed-off-by: Philippe Coval <[email protected]>
1 parent 1e579f8 commit 7a2957c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.github/workflows/build-rootfs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on: # yamllint disable-line rule:truthy
88
- '*'
99
jobs:
1010
build:
11+
permissions:
12+
contents: read
1113
runs-on: ubuntu-24.04
1214
strategy:
1315
matrix:

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on: # yamllint disable-line rule:truthy
1010

1111
jobs:
1212
build:
13+
permissions:
14+
contents: read
1315
env:
1416
project-name: z-wave-protocol-controller # Align to docker (lowercase)
1517
runs-on: ubuntu-22.04

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on: # yamllint disable-line rule:truthy
1616

1717
jobs:
1818
test:
19+
permissions:
20+
contents: read
21+
statuses: write
1922
env:
2023
project-name: z-wave-protocol-controller # Align to docker (lowercase)
2124
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)