Skip to content

Conversation

@davidcrowe
Copy link
Owner

No description provided.

Comment on lines +11 to +33
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Show TS config for validatabl
run: npx tsc --showConfig -p packages/validatabl

- name: Trace module resolution for validatabl
run: npx tsc -p packages/validatabl --traceResolution

- name: Build TypeScript monorepo
run: npm run build

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 4 days ago

To fix the problem, add a permissions block to the workflow, either at the root (applies to all jobs) or to the individual job. Since there is only one job (build), the minimal effective change is to add permissions: contents: read at the workflow root (after the name: or on: block), which limits the GITHUB_TOKEN permissions to only read contents. This is the least privilege required for standard build/check workflows, unless a job actually needs write access to contents, issues, or PRs (which is not apparent here). The change consists of adding the block:

permissions:
  contents: read

after the name: and before on: or after on:.

Suggested changeset 1
.github/workflows/build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,4 +1,6 @@
 name: Build
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Build
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants