Skip to content
Merged
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
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: ./src-tauri -> target

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install frontend dependencies
run: npm ci

- name: Biome lint
run: npx biome check .

- name: TypeScript check
run: npx tsc -b --noEmit

- name: Frontend tests
run: npx vitest run

- name: Rust clippy
working-directory: src-tauri
run: cargo clippy -- -D warnings

- name: Rust tests
working-directory: src-tauri
run: cargo test
Comment on lines +15 to +58

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

In general, the fix is to add an explicit permissions: block that restricts the GITHUB_TOKEN to the minimal scopes required. Because this workflow only checks out code and runs local tools (lint, tests, TypeScript, Rust tooling) and does not appear to modify repository contents, create releases, or otherwise need write access, contents: read is a safe minimal baseline. You can define this at the workflow root so it applies to all jobs, or at the job level; here, putting it at the root keeps the file concise and still allows per‑job overrides later if needed.

Concretely, edit .github/workflows/ci.yml and insert a permissions: block right after the name: CI line (line 1). The block should be:

permissions:
  contents: read

This will ensure the GITHUB_TOKEN is limited to read‑only repository contents for all jobs that do not override permissions. No additional imports, methods, or other definitions are required, as this is pure workflow configuration.

Suggested changeset 1
.github/workflows/ci.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/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: CI
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: CI
permissions:
contents: read

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