Skip to content

Commit 095c058

Browse files
committed
feat: retrieve current branch name for coverage workflow
1 parent 48f5901 commit 095c058

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/coverage.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ jobs:
123123
id: git-check
124124
run: echo ::set-output name=modified::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)
125125

126+
- name: Get current branch name
127+
id: get_branch
128+
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
129+
126130
- name: Update changes in GitHub repository
127131
if: steps.git-check.outputs.modified == 'true'
128132
uses: EndBug/add-and-commit@v9.1.4
@@ -131,7 +135,6 @@ jobs:
131135
author_email: github-actions[bot]@users.noreply.github.com
132136
committer_name: GitHub Actions
133137
committer_email: github-actions[bot]@users.noreply.github.com
134-
# default_author: github_actions
135138
message: "[GitHub Actions] Autogenerated JaCoCo coverage badge"
136139
fetch: false
137140
tag_push: '--force'
@@ -143,6 +146,5 @@ jobs:
143146
with:
144147
token: ${{ secrets.ALFAC_PUSH_TO_PROTECTED_BRANCH_TOKEN_CLASSIC }}
145148
force: true
146-
branch: ${{ github.event.pull_request.head.ref || github.ref }}
147-
# unprotect_reviews: true
149+
branch: ${{ env.branch_name }}
148150
debug: true

0 commit comments

Comments
 (0)