Skip to content

Commit e55e1ac

Browse files
author
khanh.nguyen
committed
Fixed CHANGELOG.md and added pull request template
1 parent 8a927b8 commit e55e1ac

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Description
2+
3+
Add a short description of the change. If this is related to an issue, please add a reference to the issue.
4+
5+
## CHANGELOG
6+
7+
* [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format.

.github/workflows/gh-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ jobs:
1717
git config user.name "MessageBird CI"
1818
- name: Prepare description
1919
run: |
20-
csplit -s CHANGELOG.md "/##/" {1}
21-
cat xx01 > CHANGELOG.tmp
20+
awk '/^## / { if (p) { exit }; { p=1; next } } p && NF' CHANGELOG.md > CHANGELOG.tmp
2221
- name: Prepare tag
2322
run: |
24-
export TAG=$(head -1 CHANGELOG.tmp | cut -d' ' -f2)
23+
export TAG=$(awk '/^## / {print $2}' CHANGELOG.md)
2524
echo "TAG=$TAG" >> $GITHUB_ENV
2625
- name: Create Release
2726
uses: actions/create-release@v1
2827
env:
2928
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3029
with:
3130
tag_name: ${{ env.TAG }}
32-
release_name: ${{ env.TAG }}
31+
release_name: Version ${{ env.TAG }}
3332
body_path: CHANGELOG.tmp
3433
draft: false
3534
prerelease: false

.github/workflows/release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Release
22

33
on:
4-
pull_request:
4+
pull_request_target:
5+
# Do not remove types labels to avoid security issue, see link for more info:
6+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/#:~:text=Add%20a%20condition%20to%20the,to%20the%20target%20repository:
57
types: [ labeled ]
68
branches:
79
- master
@@ -44,13 +46,9 @@ jobs:
4446
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
4547
- name: Checkout code
4648
uses: actions/checkout@v2
47-
- name: Checkout PR
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: |
51-
gh pr checkout ${{ github.event.pull_request.number }}
52-
git config user.email "[email protected]"
53-
git config user.name "MessageBird CI"
49+
with:
50+
ref: ${{ github.event.pull_request.head.ref }}
51+
repository: ${{ github.event.pull_request.head.repo.full_name }}
5452
- name: Prepare CHANGELOG
5553
run: |
5654
echo "${{ github.event.pull_request.body }}" | csplit -s - "/##/"
@@ -62,9 +60,11 @@ jobs:
6260
cp CHANGELOG.tmp CHANGELOG.md
6361
- name: Prepare version.py
6462
run: |
65-
sed -i "s|STRING = '[^']*'|STRING = '${{ env.VERSION }}'|" messagebird/version.py
63+
sed -i "s|VERSION = '[^']*'|VERSION = '${{ env.VERSION }}'|" messagebird/version.py
6664
- name: Commit changes
6765
run: |
66+
git config --global user.email "[email protected]"
67+
git config --global user.name "MessageBird CI"
6868
git add CHANGELOG.md messagebird/version.py
6969
git commit -m "Bump to version ${{ env.VERSION }}"
7070
- name: Push

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
# Changelog
2+
3+
## 2.0.0
4+
5+
* [FIXED] Encoding issue when JSON is serialized.
6+
* [ADDED] Voice recording deletion API.
7+
* [ADDED] Verify create email.
8+
* [CHANGED] Drop python 2 support.

0 commit comments

Comments
 (0)