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/actions/junit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
# test-reporter inputs
reporter:
description: The test reporter to use.
required: false
required: false # FIXME? true
default: jest-junit

tests_name:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/publish-test-deltas/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ runs:
using: composite
steps:
- name: publish-unit-test-result-action
uses: EnricoMi/publish-unit-test-result-action@v2.18.0
uses: EnricoMi/publish-unit-test-result-action@v2.22.0 # TODO bump
if: always()
# if: (success() || failure()) && startsWith(${{ inputs.runs-on }}, 'ubuntu') # FIXME
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/test-reporter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runs:
steps:
# SRC: https://github.com/dorny/test-reporter?tab=readme-ov-file#usage
- name: test-reporter
uses: dorny/test-reporter@v1.9.1
uses: dorny/test-reporter@v2.5.0 # TODO bump
if: always()
with:
# Name of the Check Run which will be created
Expand All @@ -77,18 +77,22 @@ runs:

# Comma-separated list of paths to test results
# Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
# All matched result files must be of the same format.
# All matched result files must be of the same format
path: ${{ inputs.files_pattern }}

# Format of test results. Supported options:
# dart-json
# dotnet-nunit
# dotnet-trx
# flutter-json
# golang-json
# java-junit
# jest-junit
# mocha-json
# phpunit-junit
# python-xunit
# rspec-json
# swift-xunit
reporter: ${{ inputs.reporter }}

# Allows you to generate only the summary.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-summary/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
using: composite
steps:
- name: pytest-results-action
uses: pmeier/pytest-results-action@v0.7.1 # FIXME
uses: pmeier/pytest-results-action@v0.7.2 # TODO bump
if: always()
with:
# A list of JUnit XML files, directories containing the former, and wildcard
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/always.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: "[C]ontinuous [I]ntegration"

on:
push:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand All @@ -29,7 +32,6 @@ jobs:
matrix:
language:
- actions
- javascript

name: "CodeQL: ${{ matrix.language }}"
uses: percebus/github-actions-compliance/.github/workflows/codeql_analyze.yml@main
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/test_actions__junit.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test actions/junit

on:
push:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -118,3 +121,26 @@ jobs:
summary_title: ""
publish-test-deltas: ${{ matrix.publish-test-deltas }}
comment_mode: off # XXX?

files_pattern__matrix:
needs: default
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
include:
- files_pattern: assets/test-results/jest/junit.xml
reporter: jest-junit

- files_pattern: assets/test-results/pytest/test-results.xml
reporter: python-xunit

name: "files_pattern: ${{ matrix.files_pattern }}"
steps:
- uses: percebus/github-actions-common/.github/actions/checkout@main
- uses: ./.github/actions/junit
with:
files_pattern: ${{ matrix.files_pattern }}
reporter: ${{ matrix.reporter }}
comment_mode: off
8 changes: 6 additions & 2 deletions .github/workflows/test_actions__publish-test-deltas.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test actions/publish-test-deltas

on:
push:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -61,6 +64,7 @@ jobs:
max-parallel: 10
matrix:
files_pattern:
- assets/test-results/pytest/test-results.xml
- assets/test-results/jest/junit.xml
- assets/**/jest/junit.xml
- "**/*junit.xml"
Expand All @@ -70,8 +74,8 @@ jobs:
- uses: ./.github/actions/publish-test-deltas
with:
files_pattern: ${{ matrix.files_pattern }}
comment_mode: off
check_name: "actions/publish-test-deltas: files_pattern:${{ matrix.files_pattern }}"
comment_mode: off

comment_mode__matrix:
needs: default
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/test_actions__test-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test actions/test-reporter

on:
push:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -50,6 +53,28 @@ jobs:
reporter: ${{ env.REPORTER }}
files_pattern: ${{ env.FILES_PATTERN }}

files_pattern__matrix:
needs: default
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
include:
- files_pattern: assets/test-results/jest/junit.xml
reporter: jest-junit

- files_pattern: assets/test-results/pytest/test-results.xml
reporter: python-xunit

name: "files_pattern: ${{ matrix.files_pattern }}"
steps:
- uses: percebus/github-actions-common/.github/actions/checkout@main
- uses: ./.github/actions/test-reporter
with:
files_pattern: ${{ matrix.files_pattern }}
reporter: ${{ matrix.reporter }}

list__matrix:
needs: default
strategy:
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/test_actions__test-summary.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test actions/test-summary

on:
push:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -40,3 +43,21 @@
with:
title: actions/test-summary:Test Summary @ ${{ matrix.OS }}
files_pattern: ${{ env.FILES_PATTERN }}

files_pattern__matrix:
needs: default
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
files_pattern:
- assets/test-results/jest/junit.xml
- assets/test-results/pytest/test-results.xml

name: "files_pattern: ${{ matrix.files_pattern }}"
steps:
- uses: percebus/github-actions-common/.github/actions/checkout@main
- uses: ./.github/actions/test-summary
with:
files_pattern: ${{ matrix.files_pattern }}
Comment on lines +48 to +63

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

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 3 months ago

To fix the problem, explicitly set least-privilege GITHUB_TOKEN permissions for the workflow or individual jobs. Since all jobs here appear to only need read access to the repository (they run tests and summarize results using local files), the safest general fix is to add a workflow-level permissions block that sets contents: read. If later some job needs more, it can override this with its own permissions section.

The single best way to fix this without changing existing functionality is:

  • Add a permissions: block near the top of .github/workflows/test_actions__test-summary.yml, alongside on: and concurrency:.
  • Set contents: read as a conservative default, which typically suffices for checkout and reading files. This affects all jobs (default, os__matrix, and files_pattern__matrix) uniformly, without modifying individual job definitions.

No imports or methods are involved because this is a YAML workflow configuration change only. The change is localized to .github/workflows/test_actions__test-summary.yml, and all existing steps and behavior remain untouched.

Suggested changeset 1
.github/workflows/test_actions__test-summary.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/test_actions__test-summary.yml b/.github/workflows/test_actions__test-summary.yml
--- a/.github/workflows/test_actions__test-summary.yml
+++ b/.github/workflows/test_actions__test-summary.yml
@@ -7,6 +7,9 @@
     branches:
       - main
 
+permissions:
+  contents: read
+
 concurrency:
   group: ${{ github.ref }}-${{ github.workflow }}
   cancel-in-progress: true
EOF
@@ -7,6 +7,9 @@
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
Copilot is powered by AI and may make mistakes. Always verify output.
1 change: 1 addition & 0 deletions assets/test-results/pytest/test-results.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="21" time="4.790" timestamp="2026-01-17T19:54:17.607651-06:00" hostname="DESKTOP-SACB1K4"><testcase classname="tests.config.logs_.test_LoggingConfig_fileConfig" name="test__logging_config__is_instance_of__LoggingConfig" time="0.005" /><testcase classname="tests.config.logs_.test_LoggingConfig_fileConfig" name="test__logger__is_instance_of__Logger" time="0.003" /><testcase classname="tests.config.os_environ.azure_openai.test_AzureOpenAISettings_dotenv" name="test__azure_openai__is_instance_of__AzureOpenAISettings" time="0.003" /><testcase classname="tests.config.os_environ.azure_openai.test_AzureOpenAISettings_dotenv" name="test__base_url__equals__env_test" time="0.003" /><testcase classname="tests.config.os_environ.azure_openai.test_AzureOpenAISettings_dotenv" name="test__deployment__equals__env_test" time="0.002" /><testcase classname="tests.config.os_environ.azure_openai.test_AzureOpenAISettings_dotenv" name="test__api_key__equals__env_test" time="0.002" /><testcase classname="tests.config.os_environ.settings.test_Settings_dotenv" name="test__settings__is_instance_of__Settings" time="0.002" /><testcase classname="tests.config.os_environ.settings.test_Settings_dotenv" name="test__environment__equals__test" time="0.002" /><testcase classname="tests.config.os_environ.settings.test_Settings_dotenv" name="test__dry_run__is__True" time="0.003" /><testcase classname="tests.config.os_environ.settings.test_Settings_dotenv" name="test__azure_ai_project_endpoint__equals__env_test" time="0.003" /><testcase classname="tests.config.os_environ.settings.test_Settings_dotenv" name="test__azure_openai__is__instance_of_AzureOpenAISettings" time="0.002" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__Settings" time="0.005" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__Logger" time="0.008" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__TokenCredential" time="0.005" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__DefaultAzureCredential" time="0.014" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__AccessToken" time="0.005" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__AzureOpenAIModelConfiguration" time="0.006" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__QAEvaluator" time="0.054" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__ContentSafetyEvaluator" time="0.545" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__dict_str_EvaluatorBase" time="0.124" /><testcase classname="tests.dependency_injection.container.test_container" name="test__contains_instance_of__dict_str_EvaluatorConfig" time="0.004" /></testsuite></testsuites>
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"prettier:check": "npm run _prettier -- --check",
"prettier:write": "npm run _prettier -- --write",
"lint": "npm run prettier:check",
"style": "npm run prettier:write",
"poststyle": "npm run lint",
"format": "npm run prettier:write",
"style": "npm run format",
"postformat": "npm run lint",
"pretest": "npm run lint",
"test": "exit 0",
"predev": "npm run style",
"predev": "npm run format",
"dev": "npm run test"
},
"repository": {
Expand Down
Loading