Skip to content

Commit 6d33ba3

Browse files
committed
feat(examples): add new build-changelog
1 parent ad3483d commit 6d33ba3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

examples/build-changelog.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build the changelog for a given version with a manual trigger
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: "Version to build changelog for"
7+
required: true
8+
type: string
9+
# You can also trigger this workflow from another workflow
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: "Version to build changelog for"
14+
required: true
15+
type: string
16+
17+
jobs:
18+
build-changelog:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
changelog: ${{ steps.build-changelog.outputs.changelog }}
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 0
27+
- uses: commitizen-tools/setup-cz@main
28+
- name: Build changelog
29+
env:
30+
GIVEN_VERSION: ${{ github.event.inputs.version }}
31+
run: |
32+
cz changelog --dry-run "${GIVEN_VERSION}" > .changelog.md
33+
- name: Display changelog
34+
run: |
35+
cat .changelog.md
36+
# You can send this file wherever you want:
37+
# - For a Github release
38+
# - Update a website
39+
# - Send it to a Slack channel
40+
# - Send it to a compliance tool

0 commit comments

Comments
 (0)