Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

jobs:
lint:
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@7a5030fa297abb7a4eac4a015cc0186fd4809ba7
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@00e84568aa8441faba7d53d88666b78e19c677d7

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: {}

Copilot Autofix

AI 24 days ago

The best solution is to explicitly set the permissions key at the root of the workflow (global level), ensuring that any job (including the delegated lint job) runs with only the required permissions. For a linting workflow that checks code but does not need to modify the repo, the minimum safe value is likely contents: read. This should be added after the name: declaration and before the on: block (i.e., before any jobs or triggers), to reduce token privileges for all jobs unless overwritten.

No additional methods, imports, or variable definitions are needed. The only change is to add a YAML block.


Suggested changeset 1
.github/workflows/lint.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/lint.yml b/.github/workflows/lint.yml
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -13,6 +13,8 @@
 # limitations under the License.
 
 name: Lint
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -13,6 +13,8 @@
# limitations under the License.

name: Lint
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
permissions:
pages: write
id-token: write
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@7a5030fa297abb7a4eac4a015cc0186fd4809ba7
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@00e84568aa8441faba7d53d88666b78e19c677d7
2 changes: 1 addition & 1 deletion .github/workflows/publish-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

jobs:
run:
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@7a5030fa297abb7a4eac4a015cc0186fd4809ba7
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@00e84568aa8441faba7d53d88666b78e19c677d7

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: {}

Copilot Autofix

AI 24 days ago

To fix this problem, we should explicitly set the permissions block in the workflow file. The preferred location is at the root level, just after the name: and before the on: block, which will apply the permissions to all jobs unless overridden. The safest minimal setting is typically to restrict all permissions unless the workflow or its jobs require more for a specific reason. Since this workflow only includes a single job that calls a reusable workflow, and it likely doesn't need write access, the best practice is to set permissions: {} at the root. This sets all permissions to none. If future jobs need more, they can override at the job level.

No additional methods, imports, or definitions are needed: just insertion of a simple YAML block.


Suggested changeset 1
.github/workflows/publish-dry-run.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/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml
--- a/.github/workflows/publish-dry-run.yml
+++ b/.github/workflows/publish-dry-run.yml
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 name: Publish Dry Run
+permissions: {}
 
 on:
   push:
EOF
@@ -13,6 +13,7 @@
# limitations under the License.

name: Publish Dry Run
permissions: {}

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
tags: ["v*"]
jobs:
build:
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@7a5030fa297abb7a4eac4a015cc0186fd4809ba7
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@00e84568aa8441faba7d53d88666b78e19c677d7
secrets:
npm-auth-token: ${{ secrets.NPM_TOKEN }}

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: {}
2 changes: 1 addition & 1 deletion .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

jobs:
test:
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@7a5030fa297abb7a4eac4a015cc0186fd4809ba7
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@00e84568aa8441faba7d53d88666b78e19c677d7

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: {}

Copilot Autofix

AI 24 days ago

To fix this problem, you should add an explicit permissions: block to the workflow file, specifying only the required permissions for jobs in this workflow. The safest minimal starting point is contents: read, meaning the workflow can only read repository contents by default, which is generally sufficient for CI, linting, and test jobs that do not need to write back to the repo or interact with issues.

Add the following block immediately after name: and before on: in .github/workflows/runtime.yml:

permissions:
  contents: read

This ensures jobs run with read-only access and narrows the risk of accidental or malicious modification of repository state. If more permissions are needed by the underlying workflow or specific steps, they can be granted as needed—otherwise, read-only is safest.

To implement:

  • Add the permissions block after the name: on line 15.
  • No other code, methods, or dependencies are required.

Suggested changeset 1
.github/workflows/runtime.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/runtime.yml b/.github/workflows/runtime.yml
--- a/.github/workflows/runtime.yml
+++ b/.github/workflows/runtime.yml
@@ -13,6 +13,8 @@
 # limitations under the License.
 
 name: Runtime
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -13,6 +13,8 @@
# limitations under the License.

name: Runtime
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.