Skip to content

Commit 331f868

Browse files
author
Alexey Alter-Pesotskiy
committed
Get branch name on Github Actions
1 parent 5a16b93 commit 331f868

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/smoke-checks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@ jobs:
8383
xcode: "13.3.1"
8484
- name: Run Tests (Debug)
8585
run: bundle exec fastlane test_ui device:"iPhone 12 (15.4)"
86+
- name: Get branch name
87+
id: get_branch_name
88+
run: echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
8689
- name: Run Sonar analysis
8790
run: bundle exec fastlane sonar_upload
8891
env:
92+
BRANCH_NAME: ${{ steps.get_branch_name.outputs.branch }}
8993
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
9094
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9195
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

fastlane/Sonarfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lane :sonar_upload do
2525
project_version: version_number
2626
)
2727
else
28-
branch = git_branch
28+
branch = ENV['BRANCH_NAME'] || git_branch
2929

3030
sonar(
3131
sonar_login: ENV['SONAR_TOKEN'],

0 commit comments

Comments
 (0)