Skip to content

Commit

Permalink
fix: Do not escape backticks & shell vars (#70)
Browse files Browse the repository at this point in the history
But use single quotes for tag message in `release_pr` workflow.

Fixes: #63
  • Loading branch information
playpauseandstop authored May 12, 2021
1 parent 543d8cf commit 1dcdb2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ jobs:
git config user.name badabump-release-bot[bot]
git config user.email badabump-release-bot[bot]@users.noreply.github.com
git tag -a ${{ steps.badabump.outputs.tag_name }} -m "${{ steps.badabump.outputs.tag_message }}"
git tag -a ${{ steps.badabump.outputs.tag_name }} -m '${{ steps.badabump.outputs.tag_message }}'
git push --tag
8 changes: 1 addition & 7 deletions src/badabump/cli/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@


EMPTY = "-"
VALUE_ESCAPE_MAPPING = (
("%", "%25"),
("$", "%24"),
("`", "%60"),
("\n", "%0A"),
("\r", "%0D"),
)
VALUE_ESCAPE_MAPPING = (("%", "%25"), ("\n", "%0A"), ("\r", "%0D"))


def diff(current_content: str, next_content: str) -> str:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"value, expected",
(
("Hello, world!", "Hello, world!"),
("$var", "%24var"),
("`pwd`", "%60pwd%60"),
("$var", "$var"),
("`pwd`", "`pwd`"),
("Multi\nLine\nString", "Multi%0ALine%0AString"),
("Multi\r\nLine\r\nString", "Multi%0D%0ALine%0D%0AString"),
),
Expand Down

0 comments on commit 1dcdb2e

Please sign in to comment.