Files
wlan-cloud-services/.github/workflows/sonar-trigger.yml
eugenetaranov-opsfleet 89610efd84 TOOLS-23: sonar (#13) - run sonar on dynamically generated list of projects in the repo
* TOOLS-23: init

* added dependency

* test

* test

* test

* added projects

* test

* maven opts Xss2m

* added all projects

* test

* disabled PR

* enabled caching, enabled tip.jfrog proxy

* fix path

* sequential check

* test2

* test3

* test4

* test5

* test6

* test

* test

* trigger 500 Internal Server Error

* trigger

* trigger

* test

* added sonar.pullrequest.branch

* sonar.pullrequest.key

* master branch

* added dispatch event

* fix maven user for jfrog

* newline

Co-authored-by: Eugene Taranov <eugene@taranov.me>
2020-07-03 11:42:43 -04:00

36 lines
944 B
YAML

name: Trigger sonar analysis
on:
push:
branches: [ master ]
jobs:
sonar:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: master
- name: Trigger sonar analysis
run: |
echo URL "https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches"
for project in $(find . -exec test -f {}/pom.xml \; -printf '%f\n' -prune); do
echo "Triggering sonar analysis for project ${project}"
curl -s --location --request POST "https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches" \
--header "Authorization: Bearer ${{ secrets.TOKEN }}" \
--header "Content-Type: application/json" \
--data-raw "{
\"event_type\": \"matrix-sonar\",
\"client_payload\": {
\"project\": \"${project}\"
}
}"
sleep 1
done