Skip to content

Commit

Permalink
add automatic changelog generation step (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos committed May 13, 2021
1 parent b696989 commit e9328e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,28 @@ jobs:
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe
- name: Create changelog
uses: arduino/create-changelog@v1
with:
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
filter-regex: '^\[(skip|changelog)[ ,-](skip|changelog)\].*'
case-insensitive-regex: true
changelog-file-path: "CHANGELOG.md"

- name: Organize release body message #use sed to clean and format the output markdown style
id: release_body
run: |
body=$(cat CHANGELOG.md)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
vt_title_pre="<details close>\n<summary>VirusTotal analysis 🛡</summary>\n\n"
vt_links="$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')"
vt_title_post="\n</details>"
vt_title_pre="${vt_title_pre//'\n'/'%0A'}"
vt_links="${vt_links//$'\n'/'%0A'}" # replace \n with a special character -> generates a single lines, \n will be reintroduced later
vt_title_post="${vt_title_post//'\n'/'%0A'}"
echo "::set-output name=RBODY::$vt_title_pre$vt_links$vt_title_post"
echo "::set-output name=RBODY::$body'%0A'$vt_title_pre$vt_links$vt_title_post"
- name: Create Github Release
uses: actions/create-release@v1
Expand Down

0 comments on commit e9328e2

Please sign in to comment.