Skip to content

Commit

Permalink
update sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Coder committed Jun 27, 2024
1 parent ea581bc commit af70abf
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Sonarcloud Scan
#run-name: "${{ fromJSON(inputs.event).display_title }} [${{ fromJSON(inputs.event).event }} ${{ fromJSON(inputs.event).head_branch }}]"
run-name: "${{ fromJSON(inputs.event).display_title }} [${{ fromJSON(inputs.event).event }} ${{ fromJSON(inputs.event).head_branch }}]"

on:
workflow_dispatch:
Expand Down Expand Up @@ -71,21 +71,33 @@ jobs:
# PR runs are against a synthetic merge commit *ontop* of the to-be-merged branch's head
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- run: |
ls -al *
- name: Checkout repository at PR base branch
if: fromJSON(inputs.event).event == 'pull_request'
uses: actions/checkout@v4
with:
ref: refs/pull/${{ steps.pr-info.outputs.pr-number }}/merge
fetch-depth: 0
path: 'checkout'
- name: Checkout repository branch
if: fromJSON(inputs.event).event != 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(inputs.event).head_branch }}
fetch-depth: 0
path: 'checkout'
- name: Ensure sonar config from master is used
shell: bash
run: |
git checkout ${{ github.ref }} -- sonar-project.properties
shopt -s dotglob
ls -al *
mv checkout/* .
ls -al *
rmdir checkout
git checkout origin/${{ github.ref_name }} -- sonar-project.properties
git status
ls -al *
- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v3
Expand Down

0 comments on commit af70abf

Please sign in to comment.