Skip to content

Commit 23ff946

Browse files
committed
Publish changelog on release
1 parent 039d1e4 commit 23ff946

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
release:
3+
types:
4+
- published
5+
6+
name: release
7+
8+
jobs:
9+
readme-changelog:
10+
name: Publish changelog to Readme
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Extract release data
14+
id: release
15+
run: |
16+
echo "title=${{ github.event.release.name }}" >> $GITHUB_OUTPUT
17+
{
18+
echo "body<<EOF"
19+
echo "${{ github.event.release.body }}"
20+
echo "EOF"
21+
} >> $GITHUB_OUTPUT
22+
23+
- name: Install jq
24+
run: sudo apt-get update && sudo apt-get install -y jq
25+
26+
- name: Publish changelog to Readme
27+
env:
28+
README_API_KEY: ${{ secrets.README_API_KEY }}
29+
run: |
30+
jq -n --arg title "Java Unified SDK ${{ steps.release.outputs.title }}" \
31+
--arg body "${{ steps.release.outputs.body }}" \
32+
'{
33+
title: $title,
34+
content: {
35+
body: $body
36+
},
37+
privacy: { view: "public" }
38+
}' > payload.json
39+
40+
curl --location 'https://api.readme.com/v2/changelogs' \
41+
--header "Authorization: Bearer $README_API_KEY" \
42+
--header 'Content-Type: application/json' \
43+
--data @payload.json

0 commit comments

Comments
 (0)