From 694b43eb93ba3aa2444688eae7e93c292180a458 Mon Sep 17 00:00:00 2001 From: Colin Seymour Date: Fri, 30 Aug 2024 13:10:24 +0100 Subject: [PATCH] Only include Teslamate release notes if updated since last release (#38) --- .github/workflows/releaser.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index 205077c..75e8eb0 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -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