Skip to content

Commit

Permalink
🩹 Fix GITHUB_SUMMARY_STEP message for promote
Browse files Browse the repository at this point in the history
The promotion workflow was using double-quotes instead of single-quotes
(`"` instead of `'`). This is resulting in backticks being interpreted
as a subshell instead of what it's meant to be, which is a markdown
code-span identifier. Additionally, the table format was incorrect,
which leads to unexpected appearance.

This fixes the above by using `'`, and by adding the appropriate
separator so that the table will display correctly.
  • Loading branch information
bitwizeshift committed Dec 12, 2023
1 parent 1866f58 commit 21b3b3d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,29 @@ jobs:
if: success()
run: |
sha1=$(git rev-parse --short HEAD)
echo "# ⏩ Accepted changes from `develop` into `master`" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "${sha1} is the new HEAD of `master`" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "## Summary" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "Below are commits being promoted" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo '# ⏩ Accepted changes from `develop` into `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo '${sha1} is the new HEAD of `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo '## Summary' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo 'Below are commits being promoted' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
old_sha1=${{steps.update-branch.outputs.old_sha1}}
new_sha1=${{steps.update-branch.outputs.new_sha1}}
url_base=https://github.com/${{github.repository}}/commit/
echo "| SHA1 | Message |" >> "${GITHUB_STEP_SUMMARY}"
echo "|------|---------|" >> "${GITHUB_STEP_SUMMARY}"
git log \
--pretty="format:| %h | %s |" \
--pretty='format:| [`%h`](https://github.com/${{github.repository}}/commit/%h) | %s |' \
--no-show-signature \
${old_sha1}..${new_sha1} >> "${GITHUB_STEP_SUMMARY}"
- name: Summarize Failure
if: failure()
run: |
sha1=$(git rev-parse --short HEAD)
echo "# 🛑 Rejected changes from `develop` into `master`" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
echo "A failure occurred, and `master` was not able to be updated" >> "${GITHUB_STEP_SUMMARY}"
echo '# 🛑 Rejected changes from `develop` into `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo 'A failure occurred, and `master` was not able to be updated' >> "${GITHUB_STEP_SUMMARY}"

0 comments on commit 21b3b3d

Please sign in to comment.