Skip to content

Commit 818c290

Browse files
committed
ci/update: cleanup summary step
1 parent 62a0dfb commit 818c290

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.github/workflows/update.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,25 @@ jobs:
176176
177177
- name: Print summary
178178
if: steps.pr.outputs.pull-request-number
179+
env:
180+
pr_num: ${{ steps.pr.outputs.pull-request-number }}
181+
pr_url: ${{ steps.pr.outputs.pull-request-url }}
182+
pr_branch: ${{ steps.pr.outputs.pull-request-branch }}
183+
head: ${{ steps.pr.outputs.pull-request-head-sha }}
184+
operation: ${{ steps.pr.outputs.pull-request-operation }}
179185
run: |
180-
num="${{ steps.pr.outputs.pull-request-number }}"
181-
pr_url="${{ steps.pr.outputs.pull-request-url }}"
182-
pr_branch="${{ steps.pr.outputs.pull-request-branch }}"
183-
head="${{ steps.pr.outputs.pull-request-head-sha }}"
184-
operation="${{ steps.pr.outputs.pull-request-operation }}"
185-
186+
short=${head:0:6}
186187
# stdout
187-
echo "${head:0:6} pushed to ${pr_branch}"
188-
echo "${pr} was ${operation}."
189-
190-
# markdown summary
191-
echo "## ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
192-
echo >> $GITHUB_STEP_SUMMARY
193-
echo "\`${head:0:6}\` pushed to \`${pr_branch}\`" >> $GITHUB_STEP_SUMMARY
194-
echo >> $GITHUB_STEP_SUMMARY
195-
echo "[#${num}](${pr_url}) was ${operation}." >> $GITHUB_STEP_SUMMARY
196-
echo >> $GITHUB_STEP_SUMMARY
188+
echo "${short} pushed to ${pr_branch}"
189+
echo "#${pr_num} was ${operation}: ${pr_url}"
190+
( # markdown summary
191+
echo "## ${{ github.ref_name }}"
192+
echo
193+
echo "\`${short}\` pushed to \`${pr_branch}\`"
194+
echo
195+
echo "[#${pr_num}](${pr_url}) was ${operation}."
196+
echo
197+
) >> $GITHUB_STEP_SUMMARY
197198
198199
- name: Print cancellation summary
199200
if: (!steps.pr.outputs.pull-request-number)

0 commit comments

Comments
 (0)