forked from Pr-Mex/vanessa-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.3 KB
/
main.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
40
41
42
43
44
45
name: sonar-scanner
on:
push:
branches:
- develop
jobs:
SonarScanner:
if: github.repository == 'Pr-Mex/vanessa-automation'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Configure env vars for SonarCloud scan
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
echo "::set-env name=PATH::/opt/sonar-scanner/bin:$PATH"
- name: Compute branch name
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
uses: nixel2007/branch-name@v3
- name: Извлечение версии
shell: bash
run: echo "##[set-output name=version;]` cat ./VanessaAutomation/Ext/ObjectModule.bsl | grep -oP '(?<=Версия \= ").[\d|.]*'`"
id: extract_version
- name: SonarCloud Scan on push
if: github.event_name == 'push'
uses: nixel2007/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.branch.name=${{ env.BRANCH_NAME }}
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}