-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (40 loc) · 1.5 KB
/
generate-changelog.yml
File metadata and controls
43 lines (40 loc) · 1.5 KB
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
name: Generate Changelog
on:
workflow_call:
inputs:
mode:
required: true
type: string
description: 'Mode of operation: "release" or "snapshot"'
tag_name:
required: false
type: string
description: "Current tag name (required for release mode)"
outputs:
changelog:
description: "Generated changelog"
value: ${{ jobs.generate.outputs.changelog }}
jobs:
generate:
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.generate_changelog.outputs.changelog }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
id: generate_changelog
shell: bash
run: |
chmod +x .github/scripts/generate-changelog.sh
OUTFILE=changelog_output.md
if [[ "${{ inputs.mode }}" == "release" ]]; then
.github/scripts/generate-changelog.sh "$OUTFILE" "${{ inputs.tag_name }}"
else
.github/scripts/generate-changelog.sh "$OUTFILE"
fi
echo "changelog<<CHANGELOG_EOF" >> $GITHUB_OUTPUT
cat "$OUTFILE" >> $GITHUB_OUTPUT
echo "CHANGELOG_EOF" >> $GITHUB_OUTPUT