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

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

To fix this problem, you should set the permissions key at the root level of your workflow file, or (alternatively) at the job level, to explicitly restrict the permissions granted to the Actions' GITHUB_TOKEN. Since this is a lint workflow and should not need write permissions to the repository or other resources, the safest minimum is to set permissions: contents: read, unless your lint job really needs broader access. Add the following to the root of .github/workflows/lint.yml, immediately after the name: Lint line (or before on:). No methods or imports are needed.

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@2914730fccc7df29c1337a2909e0f1786325892e
uses: 8hobbies/workflows/.github/workflows/npm-doc-pages.yml@e113c9f0e34203f6766d0f79bef908a749faab88
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@2914730fccc7df29c1337a2909e0f1786325892e
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@e113c9f0e34203f6766d0f79bef908a749faab88

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

To resolve this issue, you should add a permissions block to the workflow to explicitly restrict the GitHub Actions GITHUB_TOKEN to the minimum necessary permissions. As the workflow appears to trigger a dry-run publishβ€”which normally only requires read accessβ€”you can safely set permissions: contents: read at the top-level. This restricts the token capabilities for all jobs by default, including delegated (reusable) workflow jobs, unless their own configuration overrides it. Make this change directly after the name block and before on: (i.e., between lines 15 and 17). No new packages, imports, or variable definitions are required.

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

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

To fix the issue, add an explicit permissions block at the root level of .github/workflows/runtime.yml. This ensures that unless overridden by a job or a reusable workflow, jobs will execute with restricted permissions on the GITHUB_TOKEN. The minimal starting point should be contents: read, which is sufficient for most builds/tests and aligns with least privilege. If the workflow requires additional permissions (for example, to create issues or comment on PRs), only those permissions should be set to write.

The fix should be inserted after the name key and before on:, as per GitHub workflow formatting conventions.


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.