-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1.03 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build
'on':
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: effddfdaeebcfacbdcbaeadbebabcdebdca
SONAR_TOKEN: 811c9a490983734401ba4e491eaefc8bfa7281de
- name: Trigger API
if: always()
env:
API_URL: 'https://api.examly.io/api/updateSonarQubeForNonTeams'
run: >
REPO_NAME=$(echo "${GITHUB_REPOSITORY}" | cut -d '/' -f 2)
BRANCH_NAME=${GITHUB_REF#refs/heads/}
GITHUB_USERNAME=$GITHUB_ACTOR
API_PAYLOAD="{ \"repo_id\": \"$REPO_NAME\", \"branch_name\":
\"$BRANCH_NAME\", \"github_username\": \"$GITHUB_USERNAME\" }"
curl -X POST -H "Content-Type: application/json" -d "$API_PAYLOAD"
$API_URL