-
Notifications
You must be signed in to change notification settings - Fork 6
Migrate to reusable workflows #40
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| - develop | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| analyse: | ||
| name: Call Ledger CodeQL analysis | ||
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_codeql_checks.yml@v1 | ||
| secrets: inherit | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||||||||||||||||||||||||
| name: Ragger Tests | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||||||||
| - develop | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| ragger_tests: | ||||||||||||||||||||||||||||||||
| name: Ragger Tests | ||||||||||||||||||||||||||||||||
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 | ||||||||||||||||||||||||||||||||
| secrets: inherit | ||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+16
Check warningCode 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 AutofixAI 2 months ago In general, the fix is to add an explicit The best targeted fix without changing existing functionality is to add a workflow‑level
Suggested changeset
1
.github/workflows/ragger-tests.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | |||||||||||||||||||||||||||||
| name: Unit Tests | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||
| push: | |||||||||||||||||||||||||||||
| branches: | |||||||||||||||||||||||||||||
| - main | |||||||||||||||||||||||||||||
| - master | |||||||||||||||||||||||||||||
| - develop | |||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| unit_tests: | |||||||||||||||||||||||||||||
| name: Unit Tests | |||||||||||||||||||||||||||||
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_unit_tests.yml@v1 | |||||||||||||||||||||||||||||
| secrets: inherit | |||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+16
Check warningCode 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 AutofixAI 2 months ago In general, the fix is to declare an explicit The single best minimal fix without changing functionality is to add a root‑level permissions:
contents: readbetween the existing
Suggested changeset
1
.github/workflows/unit-tests.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 2 months ago
In general, this should be fixed by explicitly specifying a minimal
permissionsblock either at the workflow root (applies to all jobs) or on the specific job. For a CodeQL analysis workflow that only needs to read the code and upload results, the recommended least-privilege baseline is to grant read access to repository contents and security events, and (if needed) write access only where uploading security results is required.The single best fix here, without altering behavior, is to add a workflow-level
permissionsblock after theon:section and beforejobs:. A conservative, widely recommended configuration for CodeQL is:This allows the workflow to read the repository contents and upload CodeQL results as security events, while preventing broader write access with
GITHUB_TOKEN. Concretely, in.github/workflows/codeql.yml, insert these three lines between the existingpull_request:block (line 10–11) and thejobs:block (line 12). No imports or additional definitions are required.