forked from bitpay/java-bitpay-client
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.22 KB
/
release.yml
File metadata and controls
43 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
on:
release:
types:
- published
name: release
jobs:
readme-changelog:
name: Publish changelog to Readme
runs-on: ubuntu-latest
steps:
- name: Extract release data
id: release
run: |
echo "title=${{ github.event.release.name }}" >> $GITHUB_OUTPUT
{
echo "body<<EOF"
echo "${{ github.event.release.body }}"
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Publish changelog to Readme
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
run: |
jq -n --arg title "Java Unified SDK ${{ steps.release.outputs.title }}" \
--arg body "${{ steps.release.outputs.body }}" \
'{
title: $title,
content: {
body: $body
},
privacy: { view: "public" }
}' > payload.json
curl --location 'https://api.readme.com/v2/changelogs' \
--header "Authorization: Bearer $README_API_KEY" \
--header 'Content-Type: application/json' \
--data @payload.json