Skip to content

Conversation

@auscompgeek
Copy link
Member

https://github.com/astral-sh/ty

Note

ty is very much still in preview. The tests currently don't type check under ty, for reasons I'm still unsure why.

Comment on lines +68 to +79
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.6.x"
- name: Install dependencies
run: |
uv sync --locked
- run: uvx ty check robot.py

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

To fix the issue, we need to explicitly define the permissions for the ty job in the workflow file. Since the job only performs read operations (e.g., checking out the repository and running type checks), the minimal required permission is contents: read. This ensures that the job has only the necessary access to complete its tasks.

The changes will involve adding a permissions block to the ty job, specifying 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
@@ -69,2 +69,4 @@
     timeout-minutes: 5
+    permissions:
+      contents: read
 
EOF
@@ -69,2 +69,4 @@
timeout-minutes: 5
permissions:
contents: read

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