Skip to content

Commit

Permalink
Merge pull request #2 from qld-gov-au/changelogCreator
Browse files Browse the repository at this point in the history
Run changelog creator pr in publish loop
  • Loading branch information
duttonw authored Jul 30, 2024
2 parents a68ccc5 + ef6d00f commit 643862e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
11 changes: 11 additions & 0 deletions .github/bin/updateChangeLog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mkdir tmp
pushd tmp
curl -o git-chglog.tar.gz -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_linux_amd64.tar.gz
#curl -o git-chglog.tar.gz -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_darwin_amd64.tar.gz
tar -zxvf git-chglog.tar.gz
cp ./git-chglog ../git-chglog
popd
rm -rf tmp
chmod u+x git-chglog
./git-chglog -o CHANGELOG.md
rm git-chglog
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
releaseversion: ${{ github.event.inputs.releaseversion }}

- name: Update Changelog
# https://github.com/git-chglog/git-chglog#getting-started
run: ./.github/bin/updateChangeLog.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "Update changelog: ${{ github.event.inputs.releaseversion }}"
title: "Update Changelog ${{ github.event.inputs.releaseversion }}"
body: "Update changelog to reflect release changes: ${{ github.event.inputs.releaseversion }}"
branch: update-changelog
base: main

- name: Publish - Skipped
if: ${{ env.DO_DEPLOYMENT != 'true' }}
run: |
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/updateChangeLog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Changelog
on:
release:
types:
- created
- published #only on human interactions, won't be done on github action triggers
workflow_dispatch:
inputs:
description:
Expand All @@ -16,23 +16,13 @@ jobs:
fetch-depth: 0
- name: Update Changelog
# https://github.com/git-chglog/git-chglog#getting-started
run: |
mkdir tmp
pushd tmp
curl -o git-chglog.tar.gz -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_linux_amd64.tar.gz
#curl -o git-chglog.tar.gz -L https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_darwin_amd64.tar.gz
tar -zxvf git-chglog.tar.gz
cp ./git-chglog ../git-chglog
popd
rm -rf tmp
chmod u+x git-chglog
./git-chglog -o CHANGELOG.md
rm git-chglog
run: ./.github/bin/updateChangeLog.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: update changelog
title: Update Changelog
body: Update changelog to reflect release changes
commit-message: "Update changelog"
title: "Update Changelog}"
body: "Update changelog to reflect release changes"
branch: update-changelog
base: main

0 comments on commit 643862e

Please sign in to comment.