-
Notifications
You must be signed in to change notification settings - Fork 0
ci: update workflows to use main reusable workflows #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Build and Test | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
| 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
Show autofix suggestion
Hide autofix suggestion
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: readIf 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.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Publish Release package | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| release: |
| 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
Show autofix suggestion
Hide autofix suggestion
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: readThis ensures that, unless a job overrides it, all jobs in the workflow (here the single reusable workflow job) receive this minimal permission.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Publish Snapshot package | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |



No description provided.