-
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (64 loc) · 2.03 KB
/
changelog.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Changelog
on:
# Trigger the workflow on pushes to only the 'hotfix' and 'release' branches
push:
branches:
- hotfix/*
- release/*
# Trigger the workflow on manual dispatch
workflow_dispatch:
jobs:
changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/[email protected]
with:
fetch-depth: 0
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/[email protected]
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Generate a changelog
- name: Generate a changelog
uses: orhun/[email protected]
id: git-cliff
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GIT_CLIFF_TAG: "${{ steps.properties.outputs.version }}"
# Print the changelog
- name: Print the changelog
run: cat "${{ steps.git-cliff.outputs.changelog }}"
# Create pull request
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
delete-branch: true
branch-suffix: short-commit-hash
commit-message: |
docs(changelog): update the changelog file
[skip ci]
title: "docs(changelog): update the changelog file"
body: "Current pull request contains patched `CHANGELOG.md` file."
labels: documentation
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true