Template for a good new topic, formatted with Markdown :
Github
Github Actions
sonarcloud-github-action , pinned to the 1.6 release
JS, PHP
Private repositories
No error, just a lack of a PR comment after analysis successfully finishes in SonarCloud (per the results being there in the SonarCloud UI)
Create a PR in one of the affected repositories
Workarounds: None
This started happening 1-2 weeks ago for us, in both of the repositories we have the Github App turned on in. We went through and evaluated all the settings we were aware of in the SonarCloud UI and nothing seems to have been changed or modified recently either
We have no idea how this happened nor do we know how to troubleshoot it further.
Colin
(Colin)
June 22, 2022, 7:48pm
2
Hey there.
How is your GitHub Actions YAML file configured? Feel free to paste it here.
Sure here is the relevant job from that workflow
analyze-coverage:
runs-on: ubuntu-latest
needs: [ js-tests, php-tests ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download JS Coverage Results
uses: actions/download-artifact@v2
with:
name: coverage-js
path: coverage-js
- name: Donwload PHP Coverage Results
uses: actions/download-artifact@v2
with:
name: coverage-php
path: coverage-php
- name: Adjust Coverage Paths
run: |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage-php/clover.xml
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage-js/lcov.info
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v1.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
And then at the top the event triggers look like
on:
push:
workflow_dispatch:
Colin
(Colin)
June 22, 2022, 8:09pm
4
Thanks. You probably want to join the conversation here:
Thanks for sharing.
We recently made a change to our Github Actions configuration. When the scanner runs in the context of a push event, it will always configure a branch analysis instead of a PR analysis.
To get PR analysis working again you should add the
on:
pull_request
to your configuration instead of
on:
push:
branches:
- 'feature/**'
- 'renovate/**'
- 'hotfix/**'
Would that work for you usecase?
You can also make use of the branches parameter of pull_requ…
Yup that looks like it should work for us too afaict, thanks!