You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking at getting SonarCloud set up for our fork of FlHook and found that it's reliant on sonar-project.properties.
Obviously I'd rather not have to worry about accidentally pushing my version of this to the main branch, so would like to propose a workflow that generates the file using github actions and environment variables instead. Something a bit like:
name: SonarProjectPropertieson:
push:
branches: [ master ]jobs:
deploy:
runs-on: ubuntu-20.04steps:
- name: Checkout repositoryuses: actions/checkout@v2with:
submodules: true
- name: Generate sonar-project.propertiesrun: | touch sonar-project.properties echo "sonar.projectKey=$SONAR_PROJECTKEY" >> sonar-project.properties echo "sonar.organization=$SONAR_PROJECTORG" >> sonar-project.properties echo >> sonar-project.properties echo "# This is the name and version displayed in the SonarCloud UI." >> sonar-project.properties echo "sonar.projectName=$SONAR_PROJECTNAME" >> sonar-project.properties echo "sonar.projectVersion=$SONAR_PROJECTVERSION" >> sonar-project.properties echo >> sonar-project.properties echo "# Path is relative to the sonar-project.properties file. Replace '\' by '/' on Windows." >> sonar-project.properties echo "sonar.sources=." >> sonar-project.properties echo "sonar.exclusions = $SONAR_EXCLUSIONS" >> sonar-project.properties echo >> sonar-project.properties echo "# Encoding of the source code. Default is default system encoding" >> sonar-project.properties echo "sonar.sourceEncoding=UTF-8" >> sonar-project.properties cp "sonar-project.properties" staging
- name: Commit to branchrun: | cd staging echo $env:TAG > .github/workflows/flhooktag git config user.name github-actions git config user.email [email protected] git add sonar-project.properties git add .github/workflows/flhooktag git commit -m "Generate sonar-project.properties for build" git push
My knowledge of CI/CD is quite limited, so I'd appreciate it if someone like @Lazrius could take a look and let me know how viable this implementation is.
The text was updated successfully, but these errors were encountered:
IrateRedKite
changed the title
Gewnerate sonar-project.properties so forks can use SonarCloud
Generate sonar-project.properties so forks can use SonarCloud
Feb 10, 2024
In the newest version, manual sonar scanning will no longer be nessasary and our reliance on github actions will be removed. Will leave issue open until 5.0 is merged, but it is currently possible for you to have forks be scanned through the sonar portal (our config may be out of date, not tried)
I was looking at getting SonarCloud set up for our fork of FlHook and found that it's reliant on
sonar-project.properties
.Obviously I'd rather not have to worry about accidentally pushing my version of this to the main branch, so would like to propose a workflow that generates the file using github actions and environment variables instead. Something a bit like:
My knowledge of CI/CD is quite limited, so I'd appreciate it if someone like @Lazrius could take a look and let me know how viable this implementation is.
The text was updated successfully, but these errors were encountered: