-
Notifications
You must be signed in to change notification settings - Fork 2
Bump Go version to 1.25 and fix broken GitHub CI #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| build-kas: | ||
| name: Build kas | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: 1.25 | ||
| - run: PATH=$PATH:$GOPATH/bin TARGET_DIRECTORY=. make build-kas | ||
| build-agentk: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To resolve the issue, explicitly set a permissions block at the workflow level or for each job, specifying the minimum required access, namely 'contents: read'. In this context, it's best to add a global workflow-level permissions block to .github/workflows/ci.yaml immediately after the name key and before on:. This applies to all jobs unless overridden and ensures that only the minimal repository content read access is provided to the GITHUB_TOKEN, mitigating risk in all contained jobs. No changes to steps or functionality are required, only the addition of the block.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| push: | ||
| branches: |
| name: Build agentk | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: 1.25 | ||
| - run: PATH=$PATH:$GOPATH/bin TARGET_DIRECTORY=. make build-agentk | ||
| image-kas: | ||
| name: Build kas image |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To fix this issue, add an explicit permissions block at the top level of the workflow or at the relevant job level(s). The minimal and safest starting point is to give the workflow (or jobs) only contents: read access, which suffices for the actions shown (building, testing, linting code, and building Docker images), unless some jobs require additional permissions. This block should be placed after the workflow name: and before the other top-level keys like on:, env:, or jobs:.
The precise fix:
- Insert a
permissions:key withcontents: readat the root level (so it applies to all jobs).
No new methods, imports, or definitions are needed; only the permissions block is required in.github/workflows/ci.yaml.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| push: | ||
| branches: |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: PATH=$PATH:$GOPATH/bin TARGET_DIRECTORY=. make docker-kas | ||
| image-agentk: | ||
| name: Build agentk image |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To fix this issue, you should add a permissions block at the top level of the workflow file .github/workflows/ci.yaml. This block should grant only the minimal privileges required for the workflow to run correctly, typically "contents: read" for workflows that only require read access for checking out code and building/testing it. You should place the permissions block immediately after the workflow name: field and before other top-level directives like on: or env:. If you have jobs in the workflow needing write permissions (not shown in the snippet), you would add a more permissive permissions block for only those jobs.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| push: | ||
| branches: |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: PATH=$PATH:$GOPATH/bin TARGET_DIRECTORY=. make docker-agentk | ||
| test: | ||
| name: Unit test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To address this issue, you should explicitly specify a permissions: block in your workflow YAML file to restrict GitHub Actions' GITHUB_TOKEN's access. If none of your jobs need to write to repository contents, or create issues, or PRs, the minimum safe value is contents: read, which is recommended by the CodeQL warning. This block should be added at the workflow root (top-level, so it applies to all jobs unless overridden) or within individual jobs. Since the workflow currently contains only build, test, lint, and image creation steps, none of which need write access to repo contents, placing permissions: contents: read at the top level is sufficient, and allows you to follow the least privilege principle without interfering with any job's functionality.
Make this change directly below the workflow's name: block, before the on: section begins, in .github/workflows/ci.yaml.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| push: | ||
| branches: |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: 1.25 | ||
| - run: PATH=$PATH:$GOPATH/bin make test | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To fix the issue, you should explicitly set the permissions key in the workflow file to restrict the default permissions of the automatically generated GITHUB_TOKEN. Since the workflow only includes jobs for building, testing, linting, and building Docker images (with no indication that any steps require write access to the repository or related GitHub API objects), the minimal permission contents: read is likely sufficient for all jobs. The change should be placed at the root of the workflow file (directly under the name: and on: blocks) so that it applies to all jobs. This will ensure that if anyone adds permission-sensitive steps in the future, they'll have to explicitly escalate them. No extra imports, functions, or variables are required; this is a single YAML configuration addition.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: CI | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| push: | ||
| branches: |
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.25 | ||
| - uses: golangci/[email protected] | ||
| with: | ||
| version: v2.4.0 | ||
| publish-debug-docker: | ||
| name: Build and push debug kas containers | ||
| runs-on: ubuntu-latest | ||
| permissions: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
To fix this issue, add a permissions block to the lint job that grants only the minimum required permissions for the job to work (which, for linting, is only contents: read). This block should be added inside the lint job definition, alongside name and runs-on, before steps. No additional imports or method changes are necessary, as this is a workflow configuration change.
-
Copy modified lines R56-R57
| @@ -53,6 +53,8 @@ | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 |
This PR updates the Go version used in the project to 1.25 as requested.
These changes ensure compatibility with the latest Go version and restore a working CI pipeline.