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@aeea4ef82ae99732c467d6245294bbed0e0fa426
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@d98caf412242294b1c9060cab2e30ecc9c55a0f7

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

To fix the issue, we must add an explicit permissions block to the workflow file .github/workflows/lint.yml. Because the workflow only delegates jobs to a reusable workflow, the safest setting is global read-only access (the recommended starting point): permissions: contents: read. This should be placed at the root level, above the jobs: key, so it applies to all jobs unless overridden. No further changes are necessary, since the workflow does not appear to require write permissions for its own logic.

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
@@ -14,6 +14,9 @@
 
 name: Lint
 
+permissions:
+  contents: read
+
 on:
   push:
     branches: ["master"]
EOF
@@ -14,6 +14,9 @@

name: Lint

permissions:
contents: read

on:
push:
branches: ["master"]
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@aeea4ef82ae99732c467d6245294bbed0e0fa426
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@d98caf412242294b1c9060cab2e30ecc9c55a0f7
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@aeea4ef82ae99732c467d6245294bbed0e0fa426
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@d98caf412242294b1c9060cab2e30ecc9c55a0f7

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

The most appropriate fix is to add a permissions: block to the workflow at the top level. This block should appear immediately under the name: field and before the on: field. The minimal, safest default is contents: read, which restricts the workflow to only being able to read repository contents, unless a more permissive setting is required. If the reusable workflow needs additional permissions, then you’d need to consider that, but the CodeQL recommendation is to start with the minimal. Therefore, add the following lines after line 15:

permissions:
  contents: read

This will ensure that, unless overridden in the reusable workflow or specific jobs, only read access is available.


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@aeea4ef82ae99732c467d6245294bbed0e0fa426
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@d98caf412242294b1c9060cab2e30ecc9c55a0f7
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@aeea4ef82ae99732c467d6245294bbed0e0fa426
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@d98caf412242294b1c9060cab2e30ecc9c55a0f7

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

To fix this issue, you should add a permissions: block specifying the least required privilege for the workflow. Since this workflow only triggers a reusable workflow for CI purposes and likely does not require write access to repository contents, the minimal safe block would be:

permissions:
  contents: read

This block should be placed at the top level, just below the name: key and above on:. If particular jobs required more permissions, you would set their permissions: blocks individually inside them, but here a minimal global block suffices. This change ensures the GITHUB_TOKEN will only have read-only access for repository contents during this workflow, reducing security risk.

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.