Repository navigation
ci: fix code scanning alerts in workflows - #929
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ +0.00% coverage variation |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (30df84c) 1020600 22935 2.25% Head commit (542afff) 1020600 (+0) 22935 (+0) 2.25% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#929) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Unit Test Results 5 files 5 suites 11s ⏱️ Results for commit 542afff. ♻️ This comment has been updated with latest results. |
1ddc4ed to
b0d2f1a
Compare
2a9ec4f to
4c97b90
Compare
4c97b90 to
79ca74d
Compare
Default every workflow to contents: read and grant per-job write scopes only where needed: actions: read to fetch artifacts from the triggering run, and checks/pull-requests write to publish unit test results.
Download artifacts from untrusted pull request runs outside the workspace, read coverage files as data only and validate the head SHA before use. Replace the piped Codacy get.sh script with a pinned reporter release verified by SHA-256, and fix workflow_run if conditions that always evaluated to true because of a trailing newline.
054a79f to
542afff
Compare
|



Summary
Addresses the 12 open code scanning alerts. Stacked on the Dependabot catch-up PR.
Alerts 147–153, missing workflow permissions (fixed): top-level
permissions: contents: read. Grants are per job and only where needed. Publish jobs getactions: read, and the test-results job also getschecks: writeandpull-requests: write.Alerts 155–158, Sonar S8482 (fixed): replaces
bash <(curl … get.sh)with a pinnedcodacy-coverage-reporter14.1.3 download, checked withsha256sum --check. Bumping the reporter means updating the version and hash together.Alert 154, artifact poisoning (mitigated): Codacy needs the PR's coverage XML, so the untrusted artifact still has to be read. The job now:
runner.tempwith no checkouthead_shaIf CodeQL still flags this, dismissing it as "won't fix" with that reasoning seems fair.
Bug fix: the
workflow_runjobs usedif: >. The trailing newline made the condition always true, so they ran for cancelled and non-PR runs. They now use>-.Needs CI to confirm
Possible follow-up: coverage
finalruns without--commit-uuid, so it may finalise against the wrong SHA.