Skip to content

Commit

Permalink
fix: Do not convert ids to dashes in output (#19)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Before this change, IDs defined in a GitHub issue template that included a hyphen got converted to dashes for the Action output. This was mainly done to ensure nice-looking output variables. However, this is confusing as discussed in #15 (comment).
  • Loading branch information
stefanbuck committed Sep 13, 2021
1 parent 21b7212 commit 6cfd00c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -23,6 +23,6 @@ jobs:
git config user.email github-actions@github.com
git add .gitignore dist/
git commit -m "build"
git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v1
git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ Use this action to convert issues into a unified JSON structure.
## Setup

```yml
- uses: stefanbuck/github-issue-parser@v1
- uses: stefanbuck/github-issue-parser@v2
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/bug-report.yml
Expand Down
6 changes: 3 additions & 3 deletions fixtures/multiple-paragraphs/expected.json
@@ -1,4 +1,4 @@
{
"textarea_one": "1st paragraph\n\n2nd paragraph",
"textarea_two": "1st paragraph\n2nd paragraph"
}
"textarea-one": "1st paragraph\n\n2nd paragraph",
"textarea-two": "1st paragraph\n2nd paragraph"
}
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -44,7 +44,7 @@ async function run(env, eventPayload, fs, core) {

function toKey(str) {
if (idMapping[str]) {
return idMapping[str].replace(/-/g, "_");
return idMapping[str];
}

return str
Expand Down

0 comments on commit 6cfd00c

Please sign in to comment.