Skip to content

Conversation

@andrei-cristea
Copy link
Contributor

No description provided.

@sonarqubecloud
Copy link

jobs:
build-and-test:
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-build-and-test.yml@build-and-test-v1
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-build-and-test.yml@main # NOSONAR - Same organization, trusted source

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: {}

Copilot Autofix

AI about 1 month ago

To fix this issue, you should add a permissions: block at the top-level of the workflow, right after the name: line and before the on: key. This permissions block should specify the least privilege required for the job. As a minimal starting point, set contents: read, which is the safest and most restrictive option for the majority of CI jobs. If more granular permissions are needed, you can adjust accordingly. In this case, since the job only triggers a reusable workflow for building and testing, contents: read should generally suffice.

You only need to edit the .github/workflows/build-and-test.yml file.
No imports or external definitions are required for this change.


Suggested changeset 1
.github/workflows/build-and-test.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/build-and-test.yml b/.github/workflows/build-and-test.yml
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -1,4 +1,6 @@
 name: Build and Test
+permissions:
+  contents: read
 
 on:
   pull_request:
EOF
@@ -1,4 +1,6 @@
name: Build and Test
permissions:
contents: read

on:
pull_request:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +9 to +10
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-release.yml@main # NOSONAR - Same organization, trusted source
secrets: inherit # NOSONAR - Same organization, trusted source

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: {}

Copilot Autofix

AI about 1 month ago

To fix the problem, add an explicit permissions block to the workflow file .github/workflows/publish-release.yml. This block should establish the minimum permissions necessary for this workflow to execute correctly. Given the workflow seems to run upon releases and likely interacts with package contents and possibly pull-requests, a minimal starting configuration can be:

permissions:
  contents: read

If write access to contents or pull-requests is actually required (e.g., publishing releases, creating or modifying release assets/tags), then adjust accordingly by setting contents: write or adding other specific permissions such as pull-requests: write. However, unless otherwise known, start with the minimum. Edit .github/workflows/publish-release.yml to add the permissions key at the root just after the name: entry (before on:), to ensure it applies to all jobs in the workflow.

Suggested changeset 1
.github/workflows/publish-release.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/publish-release.yml b/.github/workflows/publish-release.yml
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -1,4 +1,6 @@
 name: Publish Release package
+permissions:
+  contents: read
 
 on:
   release:
EOF
@@ -1,4 +1,6 @@
name: Publish Release package
permissions:
contents: read

on:
release:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +9 to +10
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-snapshot.yml@main # NOSONAR - Same organization, trusted source
secrets: inherit # NOSONAR - Same organization, trusted source

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: {}

Copilot Autofix

AI about 1 month ago

To resolve the problem, you should add a permissions block to the workflow, limiting the GITHUB_TOKEN’s permissions to only what's necessary. Since this workflow is for publishing a snapshot (likely needs to access repository contents and possibly package registries), the minimal starting point is contents: read, unless additional permissions (like packages: write) are required by the reusable workflow. However, by default, we set it as minimally as possible, e.g., contents: read, and it can be raised if the publish step fails due to insufficient permissions.
Add the following YAML after the name definition and before on:

permissions:
  contents: read

This ensures that, unless a job overrides it, all jobs in the workflow (here the single reusable workflow job) receive this minimal permission.


Suggested changeset 1
.github/workflows/publish-snapshot.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/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml
--- a/.github/workflows/publish-snapshot.yml
+++ b/.github/workflows/publish-snapshot.yml
@@ -1,4 +1,6 @@
 name: Publish Snapshot package
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Publish Snapshot package
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@andrei-cristea andrei-cristea merged commit 9288aab into main Nov 12, 2025
6 checks passed
@andrei-cristea andrei-cristea deleted the ci branch November 12, 2025 16:16
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.

3 participants