From 82831779f7e083ca2d8dfb23688d9e9600f81f53 Mon Sep 17 00:00:00 2001 From: Bobillier Michel Date: Fri, 17 Oct 2025 11:02:07 +0200 Subject: [PATCH] Feat: optimization and doc --- .github/workflows/sonarcloud.yml | 8 +++++--- .github/workflows/test.yml | 5 +++-- README.md | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e978393..f3832fd 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -29,9 +29,11 @@ name: SonarCloud analysis on: - - push - - pull_request - + push: + branches: [ "main" ] # sonar is only available on main branch for free accounts + pull_request: + branches: [ "main" ] # sonar is only available on main branch for free accounts + workflow_dispatch: permissions: pull-requests: read # allows SonarCloud to decorate PRs with analysis results diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d44633..a34b7e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,8 +35,8 @@ jobs: - name: archive - run: git config --local user.name actions-user - - run: git config --local user.email "actions@github.com" + run: git config --local user.name "github-actions[bot]" + - run: git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - run: git add test/clover_coverage_line.svg - run: git add test/clover_coverage_branch.svg - run: git add test/cobertura_coverage_line.svg @@ -48,6 +48,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} force: true + branch: ${{ github.ref }} diff --git a/README.md b/README.md index 8b7ba14..b03b740 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Generated badges are not archived by default in your Git repository. You must ar ``` - name: archive - run: git config --local user.name actions-user - - run: git config --local user.email "actions@github.com" + run: git config --local user.name "github-actions[bot]" + - run: git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - run: git add out/coverage_line.svg - run: git add out/coverage_branch.svg - run: 'git commit -m "chore: add coverage badges" || true' @@ -46,6 +46,7 @@ Generated badges are not archived by default in your Git repository. You must ar with: github_token: ${{ secrets.GITHUB_TOKEN }} force: true + branch: ${{ github.ref }} ``` You can take inspiration from the [php-coverage-badge-test](https://github.com/athos99/php-coverage-badge-test) file to integrate php-covevrage-badge into your GitAction