-
Notifications
You must be signed in to change notification settings - Fork 18
82 lines (71 loc) · 2.33 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Workflow for creating release notes automatically based on merged pull
# requests since the last release.
name: Release Notes
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
release_notes:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get data for latest release
id: latest_release
uses: actions/github-script@v6
with:
retries: 3
result-encoding: string
script: |
const release = require('./.github/release-notes')
return await release.getLatestRelease(github, context)
- name: Get history for release and main
run: |
git checkout ${{ steps.latest_release.outputs.result }}
git checkout main
git checkout ${{ github.ref }}
- name: Categorize pull requests since last release
id: pull_requests
uses: actions/github-script@v6
env:
LATEST_RELEASE: ${{ steps.latest_release.outputs.result }}
TARGET_BRANCH: main
with:
retries: 3
result-encoding: string
script: |
const release = require('./.github/release-notes')
return await release.categorizePullRequests(github, context, exec)
- name: Get next release tag
id: next_release
uses: actions/github-script@v6
env:
LATEST_RELEASE: ${{ steps.latest_release.outputs.result }}
with:
retries: 3
result-encoding: string
script: |
const release = require('./.github/release-notes')
return await release.getNextReleaseTag()
- name: Draft release notes
id: draft_release
uses: actions/github-script@v6
env:
LATEST_RELEASE: ${{ steps.latest_release.outputs.result }}
NEXT_RELEASE: ${{ steps.next_release.outputs.result }}
PULL_REQUESTS: ${{ steps.pull_requests.outputs.result }}
with:
retries: 3
script: |
const release = require('./.github/release-notes')
return await release.draftReleaseNotes(github, context, core)