-
Notifications
You must be signed in to change notification settings - Fork 653
51 lines (46 loc) · 1.86 KB
/
release-notes.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
# adapted from https://github.com/chipsalliance/chisel/blob/main/.github/workflows/release-notes.yml
name: Generate Release Notes
on:
release:
types: [created]
workflow_dispatch:
inputs:
toTag:
description: 'Tag or ref for which to generate release notes'
required: true
fromTag:
# If you leave this blank, it'll select previous SemVer version
# WARNING: Cannot use anything older than a005498 because of the git tree merge
description: 'Tag or ref from which to start generating release notes'
required: false
jobs:
generate_release_notes:
name: Generate Release Notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Release Notes
id: release-notes
uses: mikepenz/[email protected]
with:
configuration: .github/workflows/config/release-notes.json
failOnError: true
# Amazingly, on release where the inputs are empty, this just does the right thing
# The "toTag" is the released tag, and the "fromTag" is the previous tag according to SemVer
fromTag: ${{ github.event.inputs.fromTag }}
toTag: ${{ github.event.inputs.toTag }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Report Release Notes
# Put output through env variable to make it robust to quotes
env:
CHANGELOG: ${{steps.release-notes.outputs.changelog}}
run: echo "$CHANGELOG" >> $GITHUB_STEP_SUMMARY
- name: Upload Release Notes (on release)
if: github.event_name == 'release'
uses: softprops/[email protected]
with:
body: ${{ steps.release-notes.outputs.changelog }}
- name: Error on uncategorized PRs
if: steps.release-notes.outputs.uncategorized_prs != 0
run: exit 1