Only include Teslamate release notes if updated since last release (#38)

This commit is contained in:
Colin Seymour
2024-08-30 13:10:24 +01:00
committed by GitHub
parent 04e01df081
commit 694b43eb93
+3 -2
View File
@@ -35,12 +35,13 @@ jobs:
- name: Get TeslaMate release notes
run: |
touch CHANGELOG.txt
gh pr list --repo lildude/ha-addon-teslamate --state=merged --search="Update TeslaMate" --limit=1 --json=body --jq '.[].body' | sed -n "/<\/summary>/,/<\/details>/p" | sed '1d;$d' > changelog.tmp
last_release_date=$(gh release list --repo lildude/ha-addon-teslamate --limit=1 --json=publishedAt)
gh pr list --repo lildude/ha-addon-teslamate --state=merged --search="Update TeslaMate in:title closed:>$last_release_date" --limit=1 --json=body --jq '.[].body' | sed -n "/<\/summary>/,/<\/details>/p" | sed '1d;$d' > changelog.tmp
if [ -s changelog.tmp ]; then
echo "## TeslaMate Release Notes" > CHANGELOG.txt
cat changelog.tmp >> CHANGELOG.txt
echo -e "---\n\n## Add-on Release Notes\n\n" >> CHANGELOG.txt
fi
echo -e "---\n\n## Add-on Release Notes\n\n" >> CHANGELOG.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag