Skip to content

Commit e8a7a2d

Browse files
committed
Use modified branch name
1 parent 5fa6714 commit e8a7a2d

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

.github/workflows/Android-CI.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@ on:
55
branches:
66
- master
77
pull_request:
8+
env:
9+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
10+
811

912
jobs:
10-
build:
13+
env-job:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }}
17+
name: test-job
18+
steps:
19+
- name: Sets MODIFIED_BRANCH_NAME
20+
id: env
21+
env:
22+
name: "${{env.BRANCH_NAME}}"
23+
run: |
24+
echo "MODIFIED_BRANCH_NAME=${name/\//-}" >> ${GITHUB_OUTPUT}
25+
cat ${GITHUB_OUTPUT}
1126
27+
build:
1228
runs-on: macOS-latest
13-
1429
steps:
1530
- uses: actions/checkout@v3
1631
with:
1732
fetch-depth: 0
1833
submodules: true
19-
- name: Extract branch name
20-
shell: bash
21-
run: |
22-
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
23-
id: extract_branch
2434
- name: prepare
2535
run: brew install exiftool imagemagick
2636
- name: set up JDK 17
@@ -52,7 +62,7 @@ jobs:
5262
if: ${{ always() }}
5363
uses: actions/upload-artifact@v3
5464
with:
55-
name: SlidingUp-Screenshots-${{ steps.extract_branch.outputs.branch }}
65+
name: SlidingUp-Screenshots-${{ needs.env-job.outputs.modified-branch-name }}
5666
path: |
5767
demo/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected
5868
demo/build/outputs/androidTest-results/connected
@@ -65,6 +75,6 @@ jobs:
6575
if: ${{ always() }}
6676
uses: actions/upload-artifact@v3
6777
with:
68-
name: SlidingUp-diffs-${{ steps.extract_branch.outputs.branch }}
78+
name: SlidingUp-diffs-${{ needs.env-job.outputs.modified-branch-name }}
6979
path: |
7080
screenshotDiffs

0 commit comments

Comments
 (0)