From f235f3f270456b42aa733c7e48018a710931a862 Mon Sep 17 00:00:00 2001 From: Denis Tokarev Date: Sat, 5 Apr 2025 01:39:51 +1100 Subject: [PATCH 1/3] Another attempt at including all tags in the changelog --- .github/workflows/release.yml | 59 +++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e401542..79935c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,7 +106,7 @@ jobs: - name: Generate changelog run: | changelog="" - + # Get tags newest to oldest tags=($(git tag --sort=-version:refname)) @@ -117,8 +117,10 @@ jobs: else untagged_commits=$(git --no-pager log --format="%s (%an) [%h]") fi - - future_tag="$( awk -F'"' '/"version": ".+"/{ print $4; exit; }' package.json )" + + # Get future version from package.json + future_tag="$(awk -F'"' '/"version": ".+"/{ print $4; exit; }' package.json)" + if [ -n "$untagged_commits" ]; then tag_log="### ${future_tag}\n" while IFS= read -r commit; do @@ -127,32 +129,35 @@ jobs: changelog="${tag_log}\n${changelog}" fi - # Loop over all tags, newest to oldest + # Loop from i=0 to i <= tags.length (YES, intentionally +1) for ((i=0; i<=${#tags[@]}; i++)); do current="${tags[$i]}" - next="" - - if (( i <= ${#tags[@]} - 1 )); then - next="${tags[$((i+1))]}" - commits=$(git --no-pager log --format="%s (%an) [%h]" "${next}..${current}") - else - echo "TAG (current) = (${current})" - commits=$(git --no-pager log --format="%s (%an) [%h]" "${current}") - fi - - if [ -n "$commits" ]; then - tag_log="### ${current}\n" - while IFS= read -r commit; do - tag_log+="- ${commit}\n" - done <<< "$commits" - changelog="${changelog}\n${tag_log}" - fi - done - - changelog="# Changelog\n${changelog}" - - echo -e "$changelog" - printf '%b' "$changelog" > CHANGELOG.md + next="${tags[$((i+1))]}" + + # Skip if current is empty (e.g., i == len) + if [ -z "$current" ]; then + continue + fi + + if [ -n "$next" ]; then + commits=$(git --no-pager log --format="%s (%an) [%h]" "${next}..${current}") + else + # last tag (oldest), no previous one + commits=$(git --no-pager log --format="%s (%an) [%h]" "${current}") + fi + + if [ -n "$commits" ]; then + tag_log="### ${current}\n" + while IFS= read -r commit; do + tag_log+="- ${commit}\n" + done <<< "$commits" + changelog="${changelog}\n${tag_log}" + fi +done + +changelog="# Changelog\n${changelog}" +echo -e "$changelog" +printf '%b' "$changelog" > CHANGELOG.md - name: Upload new changelog uses: actions/upload-artifact@v4 with: From 8dfd0e450801cd2dd3f721909eeb6cfeffae4607 Mon Sep 17 00:00:00 2001 From: Denis Tokarev Date: Sat, 5 Apr 2025 01:40:18 +1100 Subject: [PATCH 2/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7512122..9858255 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "async-wait-until", - "version": "2.0.26", + "version": "2.0.27", "description": "Waits until the given predicate function returns a truthy value, then resolves", "main": "./dist/index.js", "module": "./dist/index.esm.js", From acf64b1154beadad81fb18a48ca137ebb75b0805 Mon Sep 17 00:00:00 2001 From: Denis Tokarev Date: Sat, 5 Apr 2025 01:41:31 +1100 Subject: [PATCH 3/3] FIx formatting --- .github/workflows/release.yml | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79935c2..0ad6054 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -134,30 +134,30 @@ jobs: current="${tags[$i]}" next="${tags[$((i+1))]}" - # Skip if current is empty (e.g., i == len) - if [ -z "$current" ]; then - continue - fi - - if [ -n "$next" ]; then - commits=$(git --no-pager log --format="%s (%an) [%h]" "${next}..${current}") - else - # last tag (oldest), no previous one - commits=$(git --no-pager log --format="%s (%an) [%h]" "${current}") - fi - - if [ -n "$commits" ]; then - tag_log="### ${current}\n" - while IFS= read -r commit; do - tag_log+="- ${commit}\n" - done <<< "$commits" - changelog="${changelog}\n${tag_log}" - fi -done - -changelog="# Changelog\n${changelog}" -echo -e "$changelog" -printf '%b' "$changelog" > CHANGELOG.md + # Skip if current is empty (e.g., i == len) + if [ -z "$current" ]; then + continue + fi + + if [ -n "$next" ]; then + commits=$(git --no-pager log --format="%s (%an) [%h]" "${next}..${current}") + else + # last tag (oldest), no previous one + commits=$(git --no-pager log --format="%s (%an) [%h]" "${current}") + fi + + if [ -n "$commits" ]; then + tag_log="### ${current}\n" + while IFS= read -r commit; do + tag_log+="- ${commit}\n" + done <<< "$commits" + changelog="${changelog}\n${tag_log}" + fi + done + + changelog="# Changelog\n${changelog}" + echo -e "$changelog" + printf '%b' "$changelog" > CHANGELOG.md - name: Upload new changelog uses: actions/upload-artifact@v4 with: