-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (58 loc) · 1.95 KB
/
PublishReleaseAndModule.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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: PublishReleaseAndModule
on:
push:
tags:
- 'v*'
jobs:
release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 2
- name: Get changelog
id: get-changelog
uses: release-flow/keep-a-changelog-action@v2
with:
command: query
version: unreleased
- uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}
draft: true
body: ${{ steps.get-changelog.outputs.release-notes }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
tag: ${{ github.ref }}
- name: Push changelog
run: |
# Configure git with github-actions bot to make commits more pretty
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b changelog/${{ github.ref_name }}
git add CHANGELOG.md
git commit -m "docs: update changelog for ${{ github.ref_name }}"
git push origin changelog/${{ github.ref_name }}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update changelog for ${{ github.ref_name }}"
title: Update changelog for ${{ github.ref_name }}
body: Automatic update of changelog for release ${{ github.ref_name }}.
branch: changelog/${{ github.ref_name }}
labels: documentation
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }}