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@4443153b7f57ef7295e48bb1f73e90cb8b28a0c4
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@44f843881a46dc28b2d66c154b1231649b43498a

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 18 days ago

To fix the problem, you should add a permissions block at the root of the workflow file (.github/workflows/lint.yml). This will ensure that any job in the workflow does not inherit excessive permissions from the repository, but instead uses only the minimum required. Since this workflow delegates to an external lint workflow via uses, we should use contents: read (typical for lint/test/check workflows), unless you know stricter permissions are possible. The permissions block should be inserted near the top, usually after the workflow name entry.

Steps:

  • Edit .github/workflows/lint.yml.
  • Insert the following after name: Lint:
    permissions:
      contents: read
    This specifies that jobs by default only have read access to repository contents.
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@4443153b7f57ef7295e48bb1f73e90cb8b28a0c4
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@44f843881a46dc28b2d66c154b1231649b43498a
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@4443153b7f57ef7295e48bb1f73e90cb8b28a0c4
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@44f843881a46dc28b2d66c154b1231649b43498a

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 18 days ago

To address the issue, explicitly add a permissions block to the workflow file. Since all jobs are contained within the single run job that uses a reusable workflow, and unless more specific permissions are needed, the minimal, safest configuration is contents: read. This ensures the GITHUB_TOKEN available to this workflow and any called workflows is limited to read-only permission for repository contents.

  • The change should be inserted near the top-level of the workflow, i.e., after name: Publish Dry Run and before the on: block, to apply to the entire workflow by default.
  • No new methods, variables, or imports are neededβ€”just a YAML edit to add the permissions 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,8 @@
 # limitations under the License.
 
 name: Publish Dry Run
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -13,6 +13,8 @@
# limitations under the License.

name: Publish Dry Run
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/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@4443153b7f57ef7295e48bb1f73e90cb8b28a0c4
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@44f843881a46dc28b2d66c154b1231649b43498a
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@4443153b7f57ef7295e48bb1f73e90cb8b28a0c4
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@44f843881a46dc28b2d66c154b1231649b43498a

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 18 days ago

How to fix:
Insert a permissions block at the top level of the workflow (just below name: and before on: is standard), to restrict default permissions for all jobs unless individually overridden. Unless the jobs (or the called reusable workflow) require specific write permissions, you should set the minimum, e.g., contents: read.

Detailed best fix:
Insert the following minimal block:

permissions:
  contents: read

This ensures the GITHUB_TOKEN has only read access to repository contents for this workflow and all contained jobs (unless otherwise specified explicitly elsewhere). Place it directly under the name: Runtime entry in .github/workflows/runtime.yml.

What is needed:
No new methods, imports, or definitions; just an addition to the YAML workflow file.


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.