Skip to content

Commit 234ed2d

Browse files
authored
add automatic changelog generation step (#639)
1 parent 233f04a commit 234ed2d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -472,16 +472,28 @@ jobs:
472472
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
473473
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe
474474
475+
- name: Create changelog
476+
uses: arduino/create-changelog@v1
477+
with:
478+
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
479+
filter-regex: '^\[(skip|changelog)[ ,-](skip|changelog)\].*'
480+
case-insensitive-regex: true
481+
changelog-file-path: "CHANGELOG.md"
482+
475483
- name: Organize release body message #use sed to clean and format the output markdown style
476484
id: release_body
477485
run: |
486+
body=$(cat CHANGELOG.md)
487+
body="${body//'%'/'%25'}"
488+
body="${body//$'\n'/'%0A'}"
489+
body="${body//$'\r'/'%0D'}"
478490
vt_title_pre="<details close>\n<summary>VirusTotal analysis 🛡</summary>\n\n"
479491
vt_links="$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')"
480492
vt_title_post="\n</details>"
481493
vt_title_pre="${vt_title_pre//'\n'/'%0A'}"
482494
vt_links="${vt_links//$'\n'/'%0A'}" # replace \n with a special character -> generates a single lines, \n will be reintroduced later
483495
vt_title_post="${vt_title_post//'\n'/'%0A'}"
484-
echo "::set-output name=RBODY::$vt_title_pre$vt_links$vt_title_post"
496+
echo "::set-output name=RBODY::$body'%0A'$vt_title_pre$vt_links$vt_title_post"
485497
486498
- name: Create Github Release
487499
uses: actions/create-release@v1

0 commit comments

Comments
 (0)