Skip to content

Ci#5

Open
erisjak wants to merge 11 commits intomainfrom
ci
Open

Ci#5
erisjak wants to merge 11 commits intomainfrom
ci

Conversation

@erisjak
Copy link
Owner

@erisjak erisjak commented Sep 2, 2025

No description provided.

Comment on lines +9 to +24
name: CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0

- name: Build with dotnet
run: dotnet build --configuration Release

- name: dotnet publish
run: dotnet publish src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj --configuration Release -o artifacts

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

The best way to fix this issue is to add a permissions: block at the appropriate level to limit the default permissions of the workflow. In this case, since the workflow is a typical CI job that checks out code and builds it—without performing writing operations to the repository or interacting with pull requests—the minimal necessary permission is contents: read. This can be set at the root of the workflow file (immediately after the name: and before on:) to apply to all jobs unless any require a different set. No other modifications, imports, or additional definitions are needed.

Specifically, insert the following at line 2:

permissions:
  contents: read
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.
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.

1 participant