Skip to content

Feat ci/slug checker#15

Merged
omerfdmrl merged 2 commits into
mainfrom
feat-ci/slug-checker
Mar 22, 2026
Merged

Feat ci/slug checker#15
omerfdmrl merged 2 commits into
mainfrom
feat-ci/slug-checker

Conversation

@omerfdmrl
Copy link
Copy Markdown
Member

No description provided.

Comment on lines +9 to +25
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: '22'
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm check:slugs

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 2 months ago

To fix the problem, we should explicitly restrict the GITHUB_TOKEN permissions for this workflow to the minimum needed. The job only checks code (checkout, install, run pnpm check:slugs) and does not need to write to the repository or modify issues, PRs, or other resources. The minimal appropriate permission is contents: read. We can declare this either at the workflow root (applies to all jobs) or within the specific slug-check job. Since there is only one job, either is fine; adding it at the workflow root is slightly clearer and follows the recommendation pattern.

Concretely, in .github/workflows/slug-check.yml, add a permissions: block with contents: read (and nothing else) near the top of the file, at the root level, alongside name and on. This will ensure the GITHUB_TOKEN used by actions/checkout is limited to read-only access to repository contents, satisfying the CodeQL rule without changing any existing functionality of the workflow.

Suggested changeset 1
.github/workflows/slug-check.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/slug-check.yml b/.github/workflows/slug-check.yml
--- a/.github/workflows/slug-check.yml
+++ b/.github/workflows/slug-check.yml
@@ -1,5 +1,8 @@
 name: Slug Check
 
+permissions:
+    contents: read
+
 on:
     pull_request:
         branches: [main]
EOF
@@ -1,5 +1,8 @@
name: Slug Check

permissions:
contents: read

on:
pull_request:
branches: [main]
Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link
Copy Markdown

Preview Deployment is Ready!

You can test the updates in this PR in a live environment by clicking the link below:
View Preview

(This environment is specific to this PR and does not affect the main branch. The content at this link will update automatically when you push new commits to the PR.)

@omerfdmrl omerfdmrl merged commit 5270dd8 into main Mar 22, 2026
7 of 8 checks passed
@omerfdmrl omerfdmrl deleted the feat-ci/slug-checker branch March 22, 2026 16:53
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