From 0d89ec7ac749e370d74522668f93643b5877736a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez=20Ariza?= <45979455+alopezari@users.noreply.github.com> Date: Mon, 29 Apr 2024 08:10:03 +0200 Subject: [PATCH] Update post-release-updates GitHub Actions workflow to delete all trailing newlines from Release-testing-instructions.md before adding new entries. (#8719) --- .github/workflows/post-release-updates.yml | 4 +++- changelog/update-post-release-updates | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/update-post-release-updates diff --git a/.github/workflows/post-release-updates.yml b/.github/workflows/post-release-updates.yml index 813c9fd0bc1..bb9a1ef1175 100644 --- a/.github/workflows/post-release-updates.yml +++ b/.github/workflows/post-release-updates.yml @@ -155,8 +155,10 @@ jobs: echo ":warning: File "$NEXT_RELEASE_VERSION_INSTRUCTIONS_FILENAME.md" already exists. No action needed." >> $GITHUB_STEP_SUMMARY fi - # If an entry for the next version doesn't exist yet + # Check if this release version exists in Release-testing-instructions.md if ! grep -q "v$NEXT_RELEASE_VERSION" Release-testing-instructions.md; then + # If it doesn't exist, remove all trailing newlines and add the new version for this release + perl -pi -e 'BEGIN{undef $/;} s/\n+\z//' Release-testing-instructions.md echo -ne "\n* [v$NEXT_RELEASE_VERSION](https://github.com/Automattic/woocommerce-payments/wiki/$NEXT_RELEASE_VERSION_INSTRUCTIONS_FILENAME)" >> Release-testing-instructions.md echo "Added a new entry for v$NEXT_RELEASE_VERSION in \"Release-testing-instructions.md\"." >> $GITHUB_STEP_SUMMARY HAS_CHANGES=true diff --git a/changelog/update-post-release-updates b/changelog/update-post-release-updates new file mode 100644 index 00000000000..83360bae0a3 --- /dev/null +++ b/changelog/update-post-release-updates @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Just a minor change in a GitHub Actions workflow to make it more robust. + +