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

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

The best way to fix the problem is to explicitly add a permissions block near the top of the workflow file .github/workflows/lint.yml to restrict the workflow’s access to only what is strictly necessary. Because this workflow appears to only run linting via a reusable workflow (with no indications of publishing, writing to issues, or PRs), the minimal required permission should be contents: readβ€”which is the lowest required for most read-only tasks. You should add the following under the name field (above on:), unless your lint workflow specifically requires broader permissions. No other files need to be changed, and no imports are required.

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

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

To fix the problem, you should add a permissions block to the workflow, ideally at the root level, since only one job is declared. This block should explicitly restrict the GITHUB_TOKEN to only the permissions required by the workflow. As we do not know the exact requirements of the reusable workflow being invoked, the safest and recommended minimal starting point is contents: read, which only allows read access to repository content. If more permissions are needed, those can be added as required after consulting the documentation for the reusable workflow. The change should be done by inserting a permissions: section immediately after the name: field and before the on: section in the .github/workflows/publish-dry-run.yml file.

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

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

To fix this issue and meet best practices for GitHub Actions security, the workflow should be amended to explicitly set the permissions for the GITHUB_TOKEN.
The most robust and future-proof fix is to add a permissions block at the top level of the workflow (permissions: directly after name: but before on:), since this will apply the permissions setting to all jobs that do not have their own permissions.
Unless the job being called (via uses) requires more than read access, the minimal permission would be contents: read, meaning jobs can only read repository contents. If additional permissions are required by the reusable workflow, these can be adjusted accordingly (for example, granting pull-requests: write if writes to PRs are required).

Changes needed:

  • Edit .github/workflows/runtime.yml and insert a block
    permissions:
      contents: read
    
    after the name: block and before on:
  • No imports or additional 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,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.