Version Packages (#3881) #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "SonarCloud" | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
sonarcloud: | |
strategy: | |
matrix: | |
package: | |
- graphql | |
- introspector | |
- ogm | |
- plugins/graphql-plugin-subscriptions-amqp | |
runs-on: ubuntu-latest | |
environment: | |
name: sonarcloud | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Uppercase package name | |
run: | | |
lowercase_package=${{ matrix.package }} | |
lowercase_package=$(echo "$lowercase_package" | tr - _ | sed 's/plugins\///g') | |
echo "SONAR_TOKEN_SECRET=SONAR_TOKEN_${lowercase_package^^}" >>"${GITHUB_ENV}" | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
with: | |
projectBaseDir: packages/${{ matrix.package }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.NEO4J_TEAM_GRAPHQL_PERSONAL_ACCESS_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets[env.SONAR_TOKEN_SECRET] }} | |