@@ -46,10 +46,11 @@ runs:
4646 echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
4747
4848 - name : Ensure 'coverage' branch exists (create orphan if needed)
49+ env :
50+ BRANCH : ${{ steps.branch.outputs.branch }}
4951 shell : bash
5052 run : |
5153 set -euo pipefail
52- BRANCH="${{ steps.branch.outputs.branch }}"
5354 # Does 'coverage' branch exist on origin?
5455 if git ls-remote --exit-code --heads origin coverage >/dev/null 2>&1; then
5556 echo "'coverage' branch exists."
@@ -81,14 +82,16 @@ runs:
8182
8283 - name : Prepare coverage/<branch> directory
8384 shell : bash
85+ env :
86+ BRANCH : ${{ steps.branch.outputs.branch }}
8487 run : |
8588 set -euo pipefail
86- BRANCH="${{ steps.branch.outputs.branch }}"
87- mkdir -p "coverage/coverage/${BRANCH}"
89+ mkdir -p "coverage/${BRANCH}"
8890
8991 - name : Parse coverage input and generate SVG badge
9092 shell : bash
9193 env :
94+ BRANCH : ${{ steps.branch.outputs.branch }}
9295 INPUT_COVERAGE : ${{ inputs.coverage }}
9396 run : |
9497 set -euo pipefail
@@ -143,38 +146,40 @@ runs:
143146 <rect x="${LEFT_W}" width="${RIGHT_W}" height="20" fill="${HEX}"/>
144147 <rect width="${WIDTH}" height="20" fill="url(#s)"/>
145148 </g>
146- <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva ,sans-serif" font-size="11">
149+ <g fill="#fff" text-anchor="middle" font-family="Verdana, DejaVu Sans,sans-serif" font-size="11">
147150 <text x="$((LEFT_W/2))" y="15">${LABEL}</text>
148151 <text x="$((LEFT_W + RIGHT_W/2))" y="15">${VALUE}</text>
149152 </g>
150153 </svg>
151154 EOF
152155 )"
153- echo "$SVG" > "coverage/coverage/${{ steps.branch.outputs.branch } }/badge.svg"
156+ echo "$SVG" > "coverage/${BRANCH }/badge.svg"
154157
155158 - name : Copy optional report.html
156159 if : ${{ inputs.report != '' }}
160+ env :
161+ BRANCH : ${{ steps.branch.outputs.branch }}
157162 shell : bash
158163 run : |
159164 set -euo pipefail
160- BRANCH="${{ steps.branch.outputs.branch }}"
161165 SRC="${{ inputs.report }}"
162166 if [[ ! -f "$SRC" ]]; then
163167 echo "Report file not found at: $SRC" >&2
164168 exit 1
165169 fi
166- cp -f "$SRC" "coverage/coverage/ ${BRANCH}/report.html"
170+ cp -f "$SRC" "coverage/${BRANCH}/report.html"
167171
168172 - name : Commit & push changes to coverage branch
173+ env :
174+ BRANCH : ${{ steps.branch.outputs.branch }}
169175 shell : bash
170176 run : |
171177 set -euo pipefail
172- BRANCH="${{ steps.branch.outputs.branch }}"
173178 pushd coverage >/dev/null
174179 git config --local user.email "[email protected] " 175180 git config --local user.name "GitHub Action"
176- test ! -f "coverage/ ${BRANCH}/badge.svg" || git add "coverage/ ${BRANCH}/badge.svg"
177- test ! -f "coverage/ ${BRANCH}/report.html" || git add "coverage/ ${BRANCH}/report.html"
181+ test ! -f "${BRANCH}/badge.svg" || git add "${BRANCH}/badge.svg"
182+ test ! -f "${BRANCH}/report.html" || git add "${BRANCH}/report.html"
178183 if [[ -n "$(git status --porcelain)" ]]; then
179184 git commit -m "update"
180185 git push origin HEAD:coverage
@@ -184,12 +189,13 @@ runs:
184189 popd >/dev/null
185190
186191 - name : Summary
192+ env :
193+ BRANCH : ${{ steps.branch.outputs.branch }}
187194 shell : bash
188195 run : |
189196 set -euo pipefail
190- BRANCH="${{ steps.branch.outputs.branch }}"
191197 echo "Published:"
192- echo " - coverage/ ${BRANCH}/badge.svg"
193- if [[ -f "coverage/coverage/ ${BRANCH}/report.html" ]]; then
194- echo " - coverage/ ${BRANCH}/report.html"
198+ echo " - ${BRANCH}/badge.svg"
199+ if [[ -f "coverage/${BRANCH}/report.html" ]]; then
200+ echo " - ${BRANCH}/report.html"
195201 fi
0 commit comments