From 68e1dffa66332de7534a8acecbb8ed1255f42dc1 Mon Sep 17 00:00:00 2001 From: Demo Date: Wed, 20 May 2026 14:46:30 -0300 Subject: [PATCH 1/4] CI: Skip plugin repo release when SVN tag already exists Avoid E150002 on workflow re-runs by checking tags/$VERSION on WordPress.org before svn cp or svn import in both upload jobs. Co-authored-by: Cursor --- .../upload-release-to-plugin-repo.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 773a11b8ad6490..62f5d8fb6b693f 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -227,7 +227,20 @@ jobs: name: changelog trunk path: trunk + - name: Check if SVN tag already exists + id: check_svn_tag + run: | + if svn list "$PLUGIN_REPO_URL/tags/$VERSION" \ + --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ + --non-interactive --no-auth-cache 2>/dev/null | grep -q .; then + echo "::warning::SVN tag tags/$VERSION already exists. Skipping release commit to avoid E150002." + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi + - name: Commit the release + if: steps.check_svn_tag.outputs.exists != 'true' working-directory: ./trunk run: | svn st | grep '^?' | awk '{print $2}' | xargs -r svn add @@ -279,7 +292,20 @@ jobs: name: changelog trunk path: ${{ github.event.release.name }} + - name: Check if SVN tag already exists + id: check_svn_tag + run: | + if svn list "$PLUGIN_REPO_URL/tags/$VERSION" \ + --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ + --non-interactive --no-auth-cache 2>/dev/null | grep -q .; then + echo "::warning::SVN tag tags/$VERSION already exists. Skipping svn import to avoid E150002." + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi + - name: Add the new version directory and commit changes to the SVN repository + if: steps.check_svn_tag.outputs.exists != 'true' run: | svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ From 48b48a7139d4ed099268712184f4b7ac762cd869 Mon Sep 17 00:00:00 2001 From: Demo Date: Wed, 20 May 2026 14:48:42 -0300 Subject: [PATCH 2/4] Remove check from the upload stage --- .github/workflows/upload-release-to-plugin-repo.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 62f5d8fb6b693f..2fc6e82e87c4b7 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -292,20 +292,7 @@ jobs: name: changelog trunk path: ${{ github.event.release.name }} - - name: Check if SVN tag already exists - id: check_svn_tag - run: | - if svn list "$PLUGIN_REPO_URL/tags/$VERSION" \ - --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ - --non-interactive --no-auth-cache 2>/dev/null | grep -q .; then - echo "::warning::SVN tag tags/$VERSION already exists. Skipping svn import to avoid E150002." - echo "exists=true" >> "$GITHUB_OUTPUT" - else - echo "exists=false" >> "$GITHUB_OUTPUT" - fi - - name: Add the new version directory and commit changes to the SVN repository - if: steps.check_svn_tag.outputs.exists != 'true' run: | svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ From c957cdab0e0ea2b41dfdc38d5c40037a05771749 Mon Sep 17 00:00:00 2001 From: Paulo Marcos Trentin Date: Wed, 20 May 2026 20:04:16 -0300 Subject: [PATCH 3/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/upload-release-to-plugin-repo.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 2fc6e82e87c4b7..c9afdd9790f742 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -230,14 +230,23 @@ jobs: - name: Check if SVN tag already exists id: check_svn_tag run: | + svn_error_file="$(mktemp)" if svn list "$PLUGIN_REPO_URL/tags/$VERSION" \ --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ - --non-interactive --no-auth-cache 2>/dev/null | grep -q .; then + --non-interactive --no-auth-cache >/dev/null 2>"$svn_error_file"; then echo "::warning::SVN tag tags/$VERSION already exists. Skipping release commit to avoid E150002." echo "exists=true" >> "$GITHUB_OUTPUT" else - echo "exists=false" >> "$GITHUB_OUTPUT" + svn_status=$? + if grep -q 'E160013' "$svn_error_file"; then + echo "exists=false" >> "$GITHUB_OUTPUT" + else + cat "$svn_error_file" >&2 + rm -f "$svn_error_file" + exit "$svn_status" + fi fi + rm -f "$svn_error_file" - name: Commit the release if: steps.check_svn_tag.outputs.exists != 'true' From 564061211bdc32675e799e26653b87e18a749258 Mon Sep 17 00:00:00 2001 From: Demo Date: Tue, 26 May 2026 19:26:03 -0300 Subject: [PATCH 4/4] CI: Apply tag-exists guard to upload-tag job Mirror the SVN tag existence check added to the upload job so the upload-tag job's `svn import` is also skipped (with a workflow warning) when the tag is already present, avoiding E150002. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../upload-release-to-plugin-repo.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index c9afdd9790f742..d869d466387a99 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -301,7 +301,29 @@ jobs: name: changelog trunk path: ${{ github.event.release.name }} + - name: Check if SVN tag already exists + id: check_svn_tag + run: | + svn_error_file="$(mktemp)" + if svn list "$PLUGIN_REPO_URL/tags/$VERSION" \ + --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ + --non-interactive --no-auth-cache >/dev/null 2>"$svn_error_file"; then + echo "::warning::SVN tag tags/$VERSION already exists. Skipping import to avoid E150002." + echo "exists=true" >> "$GITHUB_OUTPUT" + else + svn_status=$? + if grep -q 'E160013' "$svn_error_file"; then + echo "exists=false" >> "$GITHUB_OUTPUT" + else + cat "$svn_error_file" >&2 + rm -f "$svn_error_file" + exit "$svn_status" + fi + fi + rm -f "$svn_error_file" + - name: Add the new version directory and commit changes to the SVN repository + if: steps.check_svn_tag.outputs.exists != 'true' run: | svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \