Skip to content

Commit 6428046

Browse files
authored
Github Infrastructure (#2)
* Github Infrastructure * Security updates and cleanup
1 parent b37397a commit 6428046

13 files changed

Lines changed: 119 additions & 11 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Fixes
2+
<!-- List the GitHub issue this PR resolves -->
3+
-
4+
5+
## Changes
6+
<!-- List the changes this PR introduces -->
7+
-
8+
9+
## Checklist
10+
<!-- Put an `x` in the boxes. All tasks must be completed and boxes checked before merging. -->
11+
- [ ] 🤖 This change is covered by unit tests (if applicable).
12+
- [ ] 🤹 Manual testing has been performed (if necessary).
13+
- [ ] 🛡️ Security impacts have been considered (if relevant).
14+
- [ ] 📖 Documentation updates are complete (if required).
15+
- [ ] 🧠 Third-party dependencies and TPIP updated (if required).

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
3+
registries:
4+
npm-github:
5+
type: npm-registry
6+
url: https://npm.pkg.github.com
7+
token: ${{secrets.GH_PACKAGES_TOKEN}}
8+
9+
updates:
10+
# Maintain dependencies for GitHub Actions
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
16+
# Maintain dependencies for the JavaScript package
17+
- package-ecosystem: "npm"
18+
directory: "/"
19+
registries:
20+
- npm-github
21+
schedule:
22+
interval: "weekly"

.github/workflows/bridge.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
tests:
2225
if: |
@@ -26,13 +29,18 @@ jobs:
2629
name: 'Test bridge'
2730

2831
steps:
32+
- name: Harden the runner (Audit all outbound calls)
33+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
34+
with:
35+
egress-policy: audit
36+
2937
- name: Checkout csolution-rpc repository
3038
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3139
with:
3240
fetch-depth: 0
3341

3442
- name: Set up Node.js
35-
uses: actions/setup-node@v4
43+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3644
with:
3745
node-version: 'lts/*'
3846

.github/workflows/codegen.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ concurrency:
2121
group: ${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: true
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
tests:
2629
if: |
@@ -30,13 +33,18 @@ jobs:
3033
name: 'Test codegen'
3134

3235
steps:
36+
- name: Harden the runner (Audit all outbound calls)
37+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
38+
with:
39+
egress-policy: audit
40+
3341
- name: Checkout csolution-rpc repository
3442
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3543
with:
3644
fetch-depth: 0
3745

3846
- name: Set up Node.js
39-
uses: actions/setup-node@v4
47+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4048
with:
4149
node-version: 'lts/*'
4250

@@ -59,7 +67,7 @@ jobs:
5967
path: codegen/reports/junit/testreport.xml
6068
retention-days: 1
6169
if-no-files-found: error
62-
70+
6371
- name: Archive generated interface files
6472
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6573
with:
@@ -77,6 +85,11 @@ jobs:
7785
contents: write
7886

7987
steps:
88+
- name: Harden the runner (Audit all outbound calls)
89+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
90+
with:
91+
egress-policy: audit
92+
8093
- name: Download generated files
8194
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
8295
with:

.github/workflows/codeql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
paths:
9+
- '.github/workflows/codeql.yml'
10+
- 'api/**'
11+
- 'bridge/**'
12+
- 'codegen/**'
13+
- '!**/*.md'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
runs-on: ubuntu-latest
26+
permissions:
27+
actions: read
28+
contents: read
29+
checks: write
30+
security-events: write
31+
32+
steps:
33+
- name: Harden Runner
34+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
35+
with:
36+
egress-policy: audit
37+
38+
- name: Checkout repository
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
43+
with:
44+
languages: TypeScript
45+
queries: security-extended
46+
47+
- name: Autobuild
48+
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18

api/csolution-openapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.1.0
22
info:
33
title: csolution rpc
44
version: 0.0.1
5-
description: Specification of remote procedure call methods for CMSIS csolution integration
5+
description: Specification of remote procedure call methods for CMSIS csolution integration
66
license:
77
name: Apache 2.0
88
url: http://www.apache.org/licenses/LICENSE-2.0.html

bridge/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
]
2020
}
2121
]
22-
}
22+
}

bridge/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ npm run lint
2121
node dist/server.js
2222
```
2323
By default it listens on http://localhost:3000
24-

codegen/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
}
4040
}
4141
]
42-
}
42+
}

codegen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Options:
4040
-c, --client <string> Generate TypeScript client interface (default: "./rpc-interface.ts")
4141
-s, --server <string> Generate C++ server interface (default: "./RpcInterface.h")
4242
-h, --help display help for command
43-
```
43+
```

0 commit comments

Comments
 (0)