forked from monocle2ai/monocle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Create the directory if it doesn't exist | ||
mkdir -p .github/workflows | ||
|
||
# Create the sonar-scan.yml file | ||
cat <<EOL > .github/workflows/sonar-scan.yml | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
name: Sonar Scan Workflow | ||
jobs: | ||
sonarqube: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: SonarQube Scan | ||
uses: sonarsource/[email protected] | ||
env: | ||
SONAR_TOKEN: '' | ||
SONAR_HOST_URL: '' | ||
with: | ||
args: > | ||
-Dsonar.python.coverage.reportPaths=coverage.xml | ||
-Dsonar.projectKey='' | ||
-Dsonar.projectName='' | ||
EOL | ||
|
||
echo "Sonar scan workflow file created at .github/workflows/sonar-scan.yml" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
on: | ||
push: | ||
# Trigger analysis when pushing to your main branches, and when creating a pull request. | ||
workflow_dispatch: | ||
inputs: | ||
branch_name: | ||
description: 'Name of the branch' | ||
required: true | ||
|
||
name: Sonar Scan Workflow | ||
jobs: | ||
|
@@ -10,13 +15,14 @@ jobs: | |
with: | ||
# Disabling shallow clones is recommended for improving the relevancy of reporting | ||
fetch-depth: 0 | ||
- name: SonarQube Scan | ||
uses: sonarsource/[email protected] # See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan | ||
env: | ||
SONAR_TOKEN: 'sqp_80a1df8514cf911b719c5a362c7658ee3deff62f' | ||
SONAR_HOST_URL: 'https://sq.beehyv.com' | ||
with: | ||
args: > | ||
-Dsonar.python.coverage.reportPaths=coverage.xml | ||
-Dsonar.projectKey=Okahu | ||
-Dsonar.projectName='Okahu' | ||
- name: Copy file to branch | ||
run: | | ||
git checkout ${{inputs.branch_name}} | ||
bash create-file.sh | ||
git status | ||
git add .github/workflows/sonar-scan.yml | ||
git config --local user.name "github-actions" | ||
git config --local user.email "[email protected]" | ||
git commit -m "Add file for SonarQube analysis" | ||
git push origin ${{inputs.branch_name}} | ||