Skip to content

Commit 8d2850d

Browse files
Update doc
Signed-off-by: Simon Beaudoin <sbeaudoi@qti.qualcomm.com>
1 parent a1bcceb commit 8d2850d

4 files changed

Lines changed: 11 additions & 51 deletions

File tree

docs/actions/build_container.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ This ensures published containers are functional.
102102
with:
103103
arch: arm64
104104
push-to-ghcr: true
105-
token: ${{ secrets.DEB_PKG_BOT_CI_TOKEN }}
106-
username: ${{ vars.DEB_PKG_BOT_CI_USERNAME }}
107105
```
108106
109107
## Notes

docs/package-repo-integration.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ If you prefer to set up a repository manually instead of using the template:
111111
- Require branches to be up to date
112112

113113
3. **Configure organization secrets** (already set at org level):
114-
- `DEB_PKG_BOT_CI_TOKEN` - GitHub PAT
115114
- `SEMGREP_APP_TOKEN` - For security scanning
116115

117116
4. **Configure organization variables** (already set at org level):
@@ -200,11 +199,9 @@ Create the minimal workflow files that call qcom-build-utils reusable workflows.
200199

201200
```yaml
202201
name: Pre-Merge
203-
description: |
204-
Tests that with this PR, the package builds successfully.
205202

206203
on:
207-
pull_request_target:
204+
pull_request:
208205
branches: [ debian/qcom-next ]
209206

210207
permissions:
@@ -220,9 +217,6 @@ jobs:
220217
run-abi-checker: true
221218
push-to-repo: false
222219
is-post-merge: false
223-
224-
secrets:
225-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
226220
```
227221
228222
#### .github/workflows/post-merge.yml
@@ -249,9 +243,6 @@ jobs:
249243
push-to-repo: true
250244
run-abi-checker: true
251245
is-post-merge: true
252-
253-
secrets:
254-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
255246
```
256247
257248
#### Step 4: Initial Commit
@@ -412,8 +403,6 @@ jobs:
412403
upstream-tag: ${{ github.event.inputs.upstream-tag }}
413404
upstream-repo: ${{ github.event.inputs.upstream-repo }}
414405
promote-changelog: true
415-
secrets:
416-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
417406
```
418407

419408
#### Triggering Upstream Promotion
@@ -476,7 +465,7 @@ graph TB
476465
name: Package Build PR Check
477466
478467
on:
479-
pull_request_target:
468+
pull_request:
480469
branches: [ main ]
481470
482471
permissions:
@@ -492,8 +481,6 @@ jobs:
492481
upstream-repo-ref: ${{github.head_ref}} # PR branch
493482
pkg-repo: ${{vars.PKG_REPO_GITHUB_NAME}} # Links to package repo via variable
494483
pr-number: ${{github.event.pull_request.number}}
495-
secrets:
496-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
497484
```
498485

499486
**How the variable works**:

docs/reusable-workflows.md

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ flowchart TD
5454
| `is-post-merge` | boolean | No | `false` | True if triggered by merge to debian/qcom-next |
5555
| `runner` | string | No | `lecore-prd-u2404-arm64-xlrg-od-ephem` | GitHub runner to use |
5656

57-
### Secrets
58-
59-
| Secret | Description |
60-
|--------|-------------|
61-
| `TOKEN` | GitHub PAT token for authentication |
62-
6357
### Environment Variables
6458

6559
- `REPO_URL`: `https://qualcomm-linux.github.io/pkg-oss-staging-repo/`
@@ -88,8 +82,6 @@ jobs:
8882
run-abi-checker: true
8983
push-to-repo: false
9084
is-post-merge: false
91-
secrets:
92-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
9385
```
9486
9587
#### Post-merge Build and Publish
@@ -104,8 +96,6 @@ jobs:
10496
push-to-repo: true
10597
run-abi-checker: true
10698
is-post-merge: true
107-
secrets:
108-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
10999
```
110100
111101
---
@@ -154,14 +144,13 @@ flowchart TD
154144

155145
### Secrets
156146

157-
| Secret | Description |
158-
|--------|-------------|
159-
| `TOKEN` | GitHub PAT token for authentication |
147+
| Secret | Required | Description |
148+
|--------|----------|-------------|
149+
| `PAT` | No | GitHub Personal Access Token for authenticating against **private** upstream repositories. Not required when the upstream repository is public. |
160150

161151
### Environment Variables
162152

163153
- `NORMALIZED_VERSION`: Version with 'v' prefix removed
164-
- `DISTRIBUTION`: Target distribution (default: `noble`)
165154

166155
### Workflow Steps
167156

@@ -187,8 +176,6 @@ jobs:
187176
upstream-tag: v2.1.0
188177
upstream-repo: qualcomm-linux/my-upstream-project
189178
promote-changelog: true
190-
secrets:
191-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
192179
```
193180

194181
### Notes
@@ -240,12 +227,6 @@ flowchart TD
240227
| `distro-codename` | string | No | `noble` | Distribution codename |
241228
| `runner` | string | No | `ubuntu-latest` | Runner to use |
242229

243-
### Secrets
244-
245-
| Secret | Description |
246-
|--------|-------------|
247-
| `TOKEN` | GitHub PAT token for authentication |
248-
249230
### Environment Variables
250231

251232
- `REPO_URL`: APT repository URL for ABI checking
@@ -273,7 +254,7 @@ Called from upstream repository's workflow (e.g., `.github/workflows/pkg-build-p
273254
name: Package Build PR Check
274255
275256
on:
276-
pull_request_target:
257+
pull_request:
277258
branches: [ main ]
278259
279260
jobs:
@@ -285,8 +266,6 @@ jobs:
285266
upstream-repo-ref: ${{github.head_ref}}
286267
pkg-repo: ${{vars.PKG_REPO_GITHUB_NAME}}
287268
pr-number: ${{github.event.pull_request.number}}
288-
secrets:
289-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
290269
```
291270

292271
**Setup Requirements**:
@@ -473,16 +452,13 @@ jobs:
473452
# Input parameters
474453
qcom-build-utils-ref: development
475454
# ... other inputs
476-
secrets:
477-
TOKEN: ${{secrets.DEB_PKG_BOT_CI_TOKEN}}
478455
```
479456

480457
### Required Organization Secrets
481458

482459
Package repositories need these organization secrets configured:
483460

484-
- `DEB_PKG_BOT_CI_TOKEN` - GitHub PAT for authentication
485-
- `SEMGREP_APP_TOKEN` - For security scanning
461+
- `SEMGREP_APP_TOKEN` - For security scanning (used by qcom-preflight-checks)
486462

487463
### Required Organization Variables
488464

docs/workflow-architecture.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ sequenceDiagram
216216
**Workflow Configuration** (in pkg-*/. github/workflows/pre-merge.yml):
217217
```yaml
218218
on:
219-
pull_request_target:
219+
pull_request:
220220
branches: [ debian/qcom-next ]
221221

222222
jobs:
@@ -373,14 +373,13 @@ flowchart LR
373373
1. **Centralization**: Workflow logic is centralized in qcom-build-utils to ensure consistency
374374
2. **Reusability**: Package repositories only need minimal workflow callers
375375
3. **Flexibility**: Workflows support various configurations through input parameters
376-
4. **Security**: Uses organization secrets and restricted permissions
376+
4. **Security**: Uses `GITHUB_TOKEN` (no long-lived PAT secrets needed for standard builds); restricted permissions per workflow
377377
5. **Isolation**: Each package repository is independent
378378
6. **Automation**: Automated building, testing, versioning, and publishing
379379

380380
## Security Considerations
381381

382-
- Workflows use `pull_request_target` for secure PR builds
383-
- Container credentials stored as organization secrets
384-
- Repository access controlled via GitHub PAT tokens
382+
- Workflows use `on: pull_request` (not `pull_request_target`) to prevent remote code execution (RCE): PR workflows run in the context of the PR branch with restricted permissions, so repository secrets are never exposed to untrusted code from public forks
383+
- Container registry access uses `GITHUB_TOKEN` instead of a long-lived PAT
385384
- ABI checking prevents accidental API/ABI breakage
386385
- CodeQL and security scanning via qcom-preflight-checks

0 commit comments

Comments
 (0)