Skip to content

Conversation

@DavidBlaa
Copy link
Member

No description provided.

Comment on lines +10 to +32
runs-on: windows-latest

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

- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Install .NET Upgrade Assistant
run: dotnet tool install -g upgrade-assistant

- name: Run Upgrade Assistant in analyze mode
run: |
upgrade-assistant analyze BExIS%2B%2B.sln --format json > upgrade-report.json

- name: Upload report artifact
uses: actions/upload-artifact@v3.1.3
with:
name: upgrade-report
path: upgrade-report.json

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 this problem, we should explicitly add a permissions section specifying minimum required permissions. The minimal sufficient permission for this workflow, since it only checks out source code and uploads an artifact, is contents: read. This can be set either at the workflow level (applies to all jobs) or at the job level (applies only to that job). Since there's only one job, either is technically correct, but setting it at the workflow root just after the name or on: block is clean and applies to future jobs as well.

  • Add a permissions: block at the workflow level, just after the on: block and before the jobs: block.
  • The contents of the block should be:
    permissions:
      contents: read

No new methods, imports, or definitions are required. Only the .github/workflows/main.yml file is to be edited.


Suggested changeset 1
.github/workflows/main.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/main.yml b/.github/workflows/main.yml
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -5,6 +5,9 @@
       - '**/*.sln'
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   upgrade-check:
     runs-on: windows-latest
EOF
@@ -5,6 +5,9 @@
- '**/*.sln'
workflow_dispatch:

permissions:
contents: read

jobs:
upgrade-check:
runs-on: windows-latest
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@DavidBlaa DavidBlaa merged commit cfd052e into rc Aug 29, 2025
4 checks passed
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.

4 participants