Skip to content

Commit c615ae9

Browse files
Copilotfelickz
andauthored
[WIP] Fix failing GitHub Actions job Validate test results (#192)
* Initial plan * Fix validate-test-results and configs CI job failures - Validate test results: use jq --slurp flag so all test report files are combined into a single array before selecting failing tests. Without --slurp, jq processes files independently and can produce a parse error when encountering empty/non-JSON slice output files. - Configs: add 'Install Packs' step before 'Check Configurations' to run codeql pack install for each language src directory. This ensures upstream packs (e.g. codeql/cpp-queries) are available in ~/.codeql/packages when codeql database create resolves transitive dependencies from the githubsecuritylab community packs. Co-authored-by: felickz <1760475+felickz@users.noreply.github.com> * ci: add packages: read permission to configs job for GHCR rate limiting Co-authored-by: felickz <1760475+felickz@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
1 parent 5b6f848 commit c615ae9

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
do
153153
jq --raw-output '"PASS \(map(select(.pass == true)) | length)/\(length)"' "$json_report"
154154
done
155-
FAILING_TESTS=$(jq --raw-output '.[] | select(.pass == false)' "${test_reports[@]}")
155+
FAILING_TESTS=$(jq --slurp --raw-output '.[][] | select(.pass == false)' "${test_reports[@]}")
156156
if [[ ! -z "$FAILING_TESTS" ]]; then
157157
echo "ERROR: The following tests failed:"
158158
echo $FAILING_TESTS | jq .
@@ -236,6 +236,7 @@ jobs:
236236
needs: compile-and-test
237237
permissions:
238238
contents: read
239+
packages: read # required by codeql pack install (GHCR rate limiting)
239240
pull-requests: read # required by pr-configs.sh (gh pr view)
240241

241242
steps:
@@ -252,6 +253,17 @@ jobs:
252253
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
253254
uses: ./.github/actions/install-codeql
254255

256+
- name: Install Packs
257+
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
258+
env:
259+
GITHUB_TOKEN: ${{ github.token }}
260+
run: |
261+
for lang in cpp csharp go java javascript python ruby; do
262+
if [[ -d "${lang}/src" ]]; then
263+
codeql pack install "${lang}/src"
264+
fi
265+
done
266+
255267
- name: "Check Configurations"
256268
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
257269
env:

0 commit comments

Comments
 (0)