/ .github / workflows / changelog.yaml
changelog.yaml
 1  name: Generate Github Release Notes Changelog
 2  run-name: "Generate Github Release Notes Changelog from ${{ inputs.from_ref }} to ${{ inputs.to_ref }}"
 3  
 4  on:
 5      workflow_dispatch:
 6          inputs:
 7              from_ref:
 8                  description: "Tag or github reference (e.g., 1.3.3)"
 9                  type: string
10                  required: true
11              to_ref:
12                  description: "Tag or github reference (e.g., 1.4.11)"
13                  type: string
14                  required: true
15              output_file:
16                  description: "Output file path for release notes"
17                  type: string
18                  required: false
19                  default: "RELEASE_NOTES.md"
20  
21  permissions:
22      contents: read
23      pull-requests: read
24  
25  jobs:
26      generate-changelog:
27          runs-on: ubuntu-latest
28          steps:
29              - name: Checkout repository
30                uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
31                with:
32                    fetch-depth: 0
33              - name: Generate Changelog
34                id: generate_changelog
35                uses: SolaceDev/solace-public-workflows/generate-github-release-notes@main
36                with:
37                    from-ref: ${{ inputs.from_ref }}
38                    to-ref: ${{ inputs.to_ref }}
39                    output-file: ${{ inputs.output_file }}
40                    github-token: ${{ secrets.GITHUB_TOKEN }}
41  
42              - name: Print Outputs
43                run: |
44                    echo "RELEASE_NOTES_PATH: ${{ steps.generate_changelog.outputs.release-notes-path }}"
45                    echo "TOTAL_COMMITS: ${{ steps.generate_changelog.outputs.total-commits }}"
46  
47              - name: Output Changelog
48                run: |
49                    if [ -f RELEASE_NOTES.md ]; then
50                        echo "RELEASE_NOTES.md exists."
51                    else
52                        echo "RELEASE_NOTES.md does not exist."
53                    fi
54                    cat RELEASE_NOTES.md >> $GITHUB_STEP_SUMMARY