Skip to content
Open
Changes from 6 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
20 changes: 18 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
test-php:
name: Test PHP ${{ matrix.php }} ${{ matrix.wp != '' && format( ' (WP {0}) ', matrix.wp ) || '' }}
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id-token: write is granted at the job level, which means every matrix run (and every step in those runs) can mint OIDC tokens. Since only the Codecov upload needs OIDC, consider moving coverage upload into a separate job (or otherwise restricting when it runs, e.g., only on trusted push events) so untrusted PR code paths don’t receive id-token: write unnecessarily.

Suggested change
id-token: write

Copilot uses AI. Check for mistakes.
strategy:
matrix:
php:
Expand Down Expand Up @@ -128,13 +131,26 @@ jobs:
npm run env run cli wp core version

- name: Test
run: npm run test
run: |
npm run env run tests-cli --env-cwd=wp-content/plugins/two-factor -- mkdir -p tests/logs
npm run test

- name: Retrieve coverage report from container
if: ${{ matrix.php == '8.3' && matrix.wp == 'latest' }}
continue-on-error: true
run: |
mkdir -p tests/logs
docker exec \
$(docker ps --filter "name=tests-wordpress" --format "{{.Names}}" | head -1) \
cat /var/www/html/wp-content/plugins/two-factor/tests/logs/clover.xml \
> tests/logs/clover.xml
Comment thread
masteradhoc marked this conversation as resolved.
Outdated

Comment thread
masteradhoc marked this conversation as resolved.
Outdated
- name: Upload code coverage report
if: ${{ matrix.php == '8.3' && matrix.wp == 'latest' }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
file: tests/logs/clover.xml
use_oidc: true
files: tests/logs/clover.xml
flags: phpunit
fail_ci_if_error: false
Comment thread
masteradhoc marked this conversation as resolved.
Outdated

Expand Down
Loading