Skip to content

Commit

Permalink
add changelog action
Browse files Browse the repository at this point in the history
  • Loading branch information
hovig-theo committed Sep 6, 2024
1 parent 5bceb17 commit 6631068
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update Changelog
on:
# Runs whenever a new tag is pushed
push:
tags:
- '*.*.*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# Update Changelog job
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Changelogs
run: |
changelogs=("$(find "connectors" -type f -name "CHANGELOG.md")")
version=$GITHUB_REF_NAME
date=$(date +"%Y-%m-%d")
for changelog in ${changelogs[*]}
do
echo "$changelog"
# Replace the line containing "## Unreleased" with new version and date
sed -i -e "s/^## Unreleased$/## [$v] - $date/" "$changelog"
done
- name: Commit Changelogs
run: |
git add connectors/**/CHANGELOG.md
git commit -m "update CHANGELOG.md"
git push

0 comments on commit 6631068

Please sign in to comment.