-
Notifications
You must be signed in to change notification settings - Fork 9
32 lines (30 loc) · 1.25 KB
/
trigger_sonar.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
name: Trigger Sonar
on:
pull_request:
types: [opened, synchronize, reopened]
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN_SECRET }}
BAMBOO_TOKEN_SECRET: ${{ secrets.BAMBOO_TOKEN_SECRET }}
GITHUB_TOKEN_SECRET: ${{ secrets.GIT_TOKEN_SECRET }}
GITHUB_REPO_OWNER: ${{ github.repository_owner }}
GITHUB_REPO: ${{ github.event.repository.name }}
GITHUB_PR_ID: ${{ github.event.number }}
jobs:
trigger_sonar:
if: |
github.repository == 'TrustlyInc/trustly-ios' &&
github.event.pull_request.mergeable_status != 'dirty'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
run: git clone -q https://${GITHUB_TOKEN_SECRET}@github.com/${GITHUB_REPO_OWNER}/${GITHUB_REPO}.git --depth=2
- name: Trigger Bamboo Pipeline - SonarQube Pull Request Analysis
run: |
cd "${GITHUB_REPO}" || exit
echo -e "Github PR ID : ${GITHUB_PR_ID}"
echo -e "Github repository: ${GITHUB_REPO}"
echo -e "Trigger Bamboo Pipeline"
curl --request POST \
"https://bamboo.paywithmybank.com/rest/api/latest/queue/CAS-SATAPR?bamboo.GITHUB_PR_ID=${GITHUB_PR_ID}" --data "stage&executeAllStages" \
--header "Authorization: Bearer ${BAMBOO_TOKEN_SECRET}"
shell: bash