forked from RocketChat/Rocket.Chat.ReactNative
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (30 loc) · 952 Bytes
/
generate-changelog.yml
File metadata and controls
38 lines (30 loc) · 952 Bytes
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
name: Generate Release Changelog
on:
workflow_call:
jobs:
generate-changelog:
name: Generate changelog
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
shell: bash
run: |
LATEST_RELEASE_TAG=$(git tag --sort=-creatordate | head -n 1)
if [ -z "$LATEST_RELEASE_TAG" ]; then
echo "- Improvements and bug fixes" > changelog.txt
exit 0
fi
git log "$LATEST_RELEASE_TAG"..HEAD --pretty=format:"- %s" --no-merges > changelog.txt
if [ ! -s changelog.txt ]; then
echo "- Improvements and bug fixes" > changelog.txt
fi
- name: Upload changelog artifact
uses: actions/upload-artifact@v4
with:
name: release-changelog
path: changelog.txt
retention-days: 15