Skip to content

Commit 60c0700

Browse files
committed
Fix changelog in separate GitHub Actions job step
This project includes a GitHub Actions job that generates a changelog from Git tag messages and writes the output to Markdown documents (b15efff). Some post-processing of these Git tag messages may be necessary in order for them to render properly from the Markdown documents. This post-processing is performed with `sed` commands. The `sed` commands are in the same step as the changelog generation commands, making the step difficult to read and making step failures more difficult to debug. This commit will move the `sed` commands to a separate GitHub Actions job step, and will add comments to the new step explaining why the step is needed.
1 parent 2a6a518 commit 60c0700

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ jobs:
414414
ref: develop
415415
- name: Generate changelog from Git tags
416416
run: |
417+
# Generate changelog from Git tags
418+
417419
echo '# Changelog
418420
' >CHANGELOG.md
419421
@@ -436,6 +438,38 @@ jobs:
436438
437439
git tag -l --sort=-taggerdate:iso --format="$GIT_LOG_FORMAT" >>CHANGELOG.md
438440
git tag -l --sort=-taggerdate:iso --format="$GIT_LOG_FORMAT" >>docs/changelog.md
441+
- name: Fix changelog
442+
run: |
443+
# Fix changelog
444+
#
445+
# The previous step in the GitHub Actions job generates a changelog
446+
# from Git tag messages and writes the output to Markdown documents.
447+
# https://github.com/br3ndonland/inboard/commit/b15efff7fc45759983743411fcbbd52415eb5455
448+
#
449+
# Some post-processing of these Git tag messages may be necessary in order
450+
# for them to render properly from the Markdown documents. One reason for
451+
# this post-processing is to handle "dunders" (double underscores).
452+
#
453+
# Dunder names like `__init__` have special meaning in Python.
454+
# https://docs.python.org/3/reference/datamodel.html#specialnames
455+
# https://docs.python.org/3/reference/lexical_analysis.html
456+
#
457+
# Dunders also make text bold in Markdown unless escaped with backslashes
458+
# or enclosed in backticks. When the document is transformed to HTML, the
459+
# backticks are transformed to HTML code elements.
460+
#
461+
# Some early changelog entries in this project did not enclose dunders in
462+
# backticks. When the text from these entries is formatted as Markdown and
463+
# rendered, text within dunders like `__init__` shows up as "init" in bold
464+
# because Markdown parsers read it as equivalent to `**init**`. To avoid
465+
# having these dunder names converted to bold text, the GitHub Actions job
466+
# runs a `sed` command to escape the dunders, like \_\_init\_\_.
467+
#
468+
# The changelog entry for the update to Gunicorn 23.0.0 mentions a
469+
# security vulnerability that was fixed, but this vulnerability was
470+
# actually fixed in Gunicorn 22.0.0 and described in the changelog
471+
# for inboard 0.68.0. This step removes the duplicate info.
472+
# https://github.com/br3ndonland/inboard/pull/117
439473
440474
ESCAPE_DUNDERS='s:(\s|\/)(__)(all|init|token)(__)(\s|\.py|\(\)){0,1}:\1\\_\\_\3\\_\\_\5:g'
441475
REPLACEMENT='There are several breaking changes noted in the\n[Gunicorn changelog](https://docs.gunicorn.org/en/latest/news.html).'

0 commit comments

Comments
 (0)