Extending to test out Sonar scanning and PR commenting...
This commit is contained in:
@@ -49,34 +49,45 @@ jobs:
|
|||||||
}' | jq '{index: .number}' > pr_created.json
|
}' | jq '{index: .number}' > pr_created.json
|
||||||
echo "pr_created=$(jq -c . pr_created.json)" >> "$GITHUB_OUTPUT"
|
echo "pr_created=$(jq -c . pr_created.json)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# # Job 2: Run SonarQube Analysis
|
# Job 2: Run SonarQube Analysis
|
||||||
# sonarqube-analysis:
|
sonarqube-analysis:
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# needs: check-and-create-pr
|
needs: check-and-create-pr
|
||||||
# outputs:
|
outputs:
|
||||||
# quality_gate_status: ${{ steps.quality-gate.outputs.quality-gate-status }}
|
quality_gate_status: ${{ steps.quality-gate.outputs.quality-gate-status }}
|
||||||
# steps:
|
steps:
|
||||||
# - name: Checkout Code
|
- name: Checkout Code
|
||||||
# uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# # Step 1: Run SonarQube Scan
|
# Step 1: Run SonarQube Scan
|
||||||
# - name: SonarQube Scan
|
- name: SonarQube Scan
|
||||||
# uses: sonarsource/sonarqube-scan-action@v4.1.0
|
uses: sonarsource/sonarqube-scan-action@v4.1.0
|
||||||
# env:
|
env:
|
||||||
# SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
# SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
|
||||||
# # Step 2: SonarQube Quality Gate Check
|
# Step 2: SonarQube Quality Gate Check
|
||||||
# - name: SonarQube Quality Gate
|
- name: SonarQube Quality Gate
|
||||||
# id: quality-gate
|
id: quality-gate
|
||||||
# uses: sonarsource/sonarqube-quality-gate-action@v1
|
uses: sonarsource/sonarqube-quality-gate-action@v1
|
||||||
# env:
|
env:
|
||||||
# SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
# SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Pause for quality gate results
|
||||||
|
run: sleep 10
|
||||||
|
|
||||||
# - name: Log Quality Gate Result
|
- name: Check Quality Gate Status
|
||||||
# run: |
|
uses: DesarrolloORT/sonarqube-quality-gate-action@v1
|
||||||
# echo "Quality Gate Status: ${{ steps.quality-gate.outputs.quality-gate-status }}"
|
id: quality-gate-check
|
||||||
|
with:
|
||||||
|
sonar-host-url: ${{ secrets.SONARQUBE_HOST }}
|
||||||
|
sonar-token: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
github-token: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Log Quality Gate Result
|
||||||
|
run: |
|
||||||
|
echo "Quality Gate Status: ${{ steps.quality-gate.outputs.quality-gate-status }}"
|
||||||
|
|
||||||
# # Job 3: Merge PR if Quality Gate passes
|
# # Job 3: Merge PR if Quality Gate passes
|
||||||
# merge-pr:
|
# merge-pr:
|
||||||
|
|||||||
Reference in New Issue
Block a user