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. + +