Skip to content
Draft
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
32 changes: 32 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Copilot Setup Steps

on: workflow_dispatch

jobs:
copilot-setup-steps:
name: Setup development environment for Copilot coding agent
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: FerretDB/github-actions/setup-go@main
with:
cache-key: copilot-setup

- name: Install Task and tools
run: go generate -x
working-directory: tools

- name: Initialize project dependencies
run: bin/task init

- name: Run code generators and formatters
run: bin/task gen

- name: Verify setup with short tests
run: bin/task test-short
Comment on lines +8 to +32

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

To address the issue, add an explicit permissions block to the workflow. Since the workflow involves checking out code and running local tasks, it only needs read access to the repository contents and does not require write permissions. The permissions block should be added at the workflow level (root) to apply the least privilege configuration to all jobs within the workflow.


Suggested changeset 1
.github/workflows/copilot-setup-steps.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/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
--- a/.github/workflows/copilot-setup-steps.yml
+++ b/.github/workflows/copilot-setup-steps.yml
@@ -1,5 +1,7 @@
 ---
 name: Copilot Setup Steps
+permissions:
+  contents: read
 
 on: workflow_dispatch
 
EOF
@@ -1,5 +1,7 @@
---
name: Copilot Setup Steps
permissions:
contents: read

on: workflow_dispatch

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