diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 185ba92b6..662eaf992 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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="
\nVirusTotal analysis 🛡\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
" 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