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

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

To fix the issue, add a permissions block at the root level of .github/workflows/lint.yml. Place it before the jobs: key, after the name: or on: section. Set the permission(s) required for linting to the least privileged. In almost all cases for linting jobs, only contents: read should be needed, unless the lint process comments on PRs (then you might need pull-requests: write). Since we cannot see any evidence in this snippet that write permissions are needed, the best and safest default is contents: read, which restricts the GITHUB_TOKEN to only read 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
@@ -20,6 +20,8 @@
   pull_request:
     branches: ["master"]
 
+permissions:
+  contents: read
 jobs:
   lint:
     uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@23566a16aca822bf91e20bf57b5715869e181339
EOF
@@ -20,6 +20,8 @@
pull_request:
branches: ["master"]

permissions:
contents: read
jobs:
lint:
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@23566a16aca822bf91e20bf57b5715869e181339
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,6 +25,6 @@ jobs:
permissions:
pages: write
id-token: write
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@44f843881a46dc28b2d66c154b1231649b43498a
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@23566a16aca822bf91e20bf57b5715869e181339
with:
doc-path: "docs/build"
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@44f843881a46dc28b2d66c154b1231649b43498a
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@23566a16aca822bf91e20bf57b5715869e181339

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

To fix this problem, add an explicit permissions block to .github/workflows/publish-dry-run.yml. This block should specify the minimum required permissions for GITHUB_TOKEN. Since the workflow only uses a reusable workflow for running an npm publish dry run, in most cases read-only access to repository contents is sufficient. The block can be added at the top level (after the name: and before jobs:) to apply to all jobs, unless individual jobs require different permissions. In this case, add:

permissions:
  contents: read

just beneath the name: ... line and before on:. This grants only read access to repository contents, which is a safe default. If the workflow requires additional permissions (e.g., for pull-requests), those can be added, but based on the current code, contents: read suffices.

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@44f843881a46dc28b2d66c154b1231649b43498a
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@23566a16aca822bf91e20bf57b5715869e181339
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@44f843881a46dc28b2d66c154b1231649b43498a
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@23566a16aca822bf91e20bf57b5715869e181339

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

To fix the problem, add a permissions block to the workflow to restrict the GITHUB_TOKEN permissions to the minimal necessary. Since the workflow calls a reusable workflow, and we do not know exactly which permissions are required by npm-runtime.yml, the safest starting point is to specify permissions: {} at the root level. This sets all permissions to none unless the called workflow or jobs override it. If you know which exact permissions are needed (such as contents: read), you can specify those, but adding {} ensures no unnecessary permissions are granted by default.

Edits:

  • In .github/workflows/runtime.yml, add the following block after the name: Runtime (line 15), or you may add it between the name and on (line 17).
  • The block should be:
    permissions: {}
  • No other changes, imports, or dependencies are needed.

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,7 @@
 # limitations under the License.
 
 name: Runtime
+permissions: {}
 
 on:
   push:
EOF
@@ -13,6 +13,7 @@
# limitations under the License.

name: Runtime
permissions: {}

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