-
Notifications
You must be signed in to change notification settings - Fork 1.3k
run prettier #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run prettier #995
Conversation
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
|
||
- run: npm ci | ||
- run: npm run build | ||
- run: npm test | ||
- run: npm run lint | ||
|
||
publish: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
To fix the issue, we should explicitly set a permissions
block so that the build
job receives only those privileges necessary for its steps—in this case, likely just read access to repository contents. Following least privilege principles, we should set permissions: contents: read
at the build
job level (since the publish
job already has a tighter block) to ensure both jobs use the minimum required scope. No changes elsewhere are needed.
- Add the following block under
build:
in.github/workflows/main.yml
, aboveruns-on
:permissions: contents: read
- No imports, methods, or definitions needed.
-
Copy modified lines R15-R16
@@ -12,6 +12,8 @@ | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
|
||
steps: |
run prettier after #976