Skip to content

Conversation

@cpendery
Copy link
Member

No description provided.

Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Signed-off-by: Chapman Pendery <[email protected]>
Comment on lines +10 to +54
strategy:
matrix:
include:
- os: macos-latest
arch: arm64
artifact-name: inshellisense-darwin-arm64
- os: macos-15-intel
arch: x64
artifact-name: inshellisense-darwin-x64
- os: ubuntu-latest
arch: x64
artifact-name: inshellisense-linux-x64
- os: ubuntu-24.04-arm
arch: arm64
artifact-name: inshellisense-linux-arm64
- os: windows-latest
arch: x64
artifact-name: inshellisense-win32-x64
- os: windows-11-arm
arch: arm64
artifact-name: inshellisense-win32-arm64

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22

- run: npm ci

- run: npm run build

- run: npm run package

- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: pkg/*.tgz
if-no-files-found: error

combine:

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: {contents: read}

Copilot Autofix

AI 6 days ago

In general, this should be fixed by explicitly declaring a permissions block to limit what the GITHUB_TOKEN can do. The safest and simplest approach is to set permissions at the workflow root so it applies to all jobs that don’t override it. For this workflow, we can restrict contents to read, which is sufficient for actions/checkout and all subsequent build/packaging steps, and no other permissions are needed.

Concretely, in .github/workflows/pkg.yml, add a root-level permissions: block between the name: and on: keys. This block will look like:

permissions:
  contents: read

No other changes to jobs or steps are required. This does not change any existing functionality, because none of the steps rely on write access to repository contents or other resources; it only reduces the potential impact if a job is compromised.

Suggested changeset 1
.github/workflows/pkg.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/pkg.yml b/.github/workflows/pkg.yml
--- a/.github/workflows/pkg.yml
+++ b/.github/workflows/pkg.yml
@@ -1,5 +1,8 @@
 name: Package
 
+permissions:
+  contents: read
+
 on:
   push:
     tags:
EOF
@@ -1,5 +1,8 @@
name: Package

permissions:
contents: read

on:
push:
tags:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +55 to +69
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
name: inshellisense-all
path: artifacts/*.tgz
if-no-files-found: error No newline at end of file

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

In general, the fix is to explicitly define a permissions block that restricts the GITHUB_TOKEN to the minimal scopes necessary. Because this workflow only checks out code, installs dependencies, builds/packages, and uploads/downloads artifacts, it only requires read access to repository contents; it does not need to write to issues, pull requests, or repository contents. The best fix is to add a permissions block at the root of the workflow so it applies to all jobs (build and combine) without altering their behavior.

Concretely, in .github/workflows/pkg.yml, insert a permissions: section after the name: Package line (line 1) and before the on: block. Set contents: read as a safe minimal scope. No additional imports or methods are required; this is purely a YAML configuration change to the workflow file. The jobs and steps remain unchanged.

Suggested changeset 1
.github/workflows/pkg.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/pkg.yml b/.github/workflows/pkg.yml
--- a/.github/workflows/pkg.yml
+++ b/.github/workflows/pkg.yml
@@ -1,5 +1,8 @@
 name: Package
 
+permissions:
+  contents: read
+
 on:
   push:
     tags:
EOF
@@ -1,5 +1,8 @@
name: Package

permissions:
contents: read

on:
push:
tags:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants