Commit f9ac758
Potential fix for code scanning alert no. 88: Workflow does not contain permissions
Below is a minimal fix to satisfy GitHub’s requirement for explicit token permissions. Add a top-level `permissions` block—here we give only read access to repo contents, which is enough for a simple pre-compile check.
```yaml
name: Check Precompiled
on:
pull_request:
branches:
- canary
- main
- patch*
workflow_dispatch:
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Required: explicitly scope the GITHUB_TOKEN
permissions:
contents: read
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Run pre-compiled check
run: ./scripts/check-pre-compiled.sh
```
—
Additional tips:
• If you ever need to write status comments or push tags, add `contents: write` (or more granular scopes).
• For workflows calling external registries, you may need `packages: write`.
• To use OpenID Connect (OIDC) in a later step, add `id-token: write`.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Mustapha BARKI <code4yo@gmail.com>1 parent 52c891c commit f9ac758
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
0 commit comments