Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

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.
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

jobs:
publish-release:
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-release.yml@publish-release-v1
secrets: inherit
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-release.yml@main # NOSONAR - Same organization, trusted source
secrets: inherit # NOSONAR - Same organization, trusted source
Comment on lines +9 to +10

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.
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

jobs:
publish-snapshot:
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-snapshot.yml@publish-snapshot-v1
secrets: inherit
uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-snapshot.yml@main # NOSONAR - Same organization, trusted source
secrets: inherit # NOSONAR - Same organization, trusted source
Comment on lines +9 to +10

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.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
group = org.eclipse.keyple
title = Keyple Plugin Storage Card API
description = API dedicated to standardize communication between Keyple plugins and APDU interpreters for storage card processing
version = 1.0.0-SNAPSHOT
version = 1.0.1-SNAPSHOT

# Java Configuration
javaSourceLevel = 1.8
Expand Down