From 83d009f891710800c650ee5119b20fdf3485b583 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 10 Sep 2025 12:43:43 -0400 Subject: [PATCH] chore: update PR plugin build workflow to prevent SHA conflicts - Modified the GitHub Actions workflow to generate versioned TXZ URLs and keys, ensuring unique paths for each pull request. - Updated comments for clarity regarding the purpose of versioning in the upload process. --- .github/workflows/pr-plugin-build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-plugin-build.yml b/.github/workflows/pr-plugin-build.yml index e87749e46..0f4f59469 100644 --- a/.github/workflows/pr-plugin-build.yml +++ b/.github/workflows/pr-plugin-build.yml @@ -49,11 +49,12 @@ jobs: # Also keep PR info for reference PR_VERSION="pr.${{ github.event.pull_request.number }}.$(git rev-parse --short HEAD)" - # Generate stable URLs and keys once + # Generate URLs with versioned TXZ to prevent SHA conflicts S3_BASE_URL="${{ secrets.CLOUDFLARE_PREVIEW_BUCKET_BASE_URL }}/pr-plugins/pr-${{ github.event.pull_request.number }}" - TXZ_URL="${S3_BASE_URL}/webgui-pr-${{ github.event.pull_request.number }}.tar.gz" + # TXZ gets unique versioned path to prevent SHA conflicts on updates + TXZ_URL="${S3_BASE_URL}/webgui-pr-${{ github.event.pull_request.number }}-${VERSION}.tar.gz" PLUGIN_URL="${S3_BASE_URL}/webgui-pr-${{ github.event.pull_request.number }}.plg" - TXZ_KEY="pr-plugins/pr-${{ github.event.pull_request.number }}/webgui-pr-${{ github.event.pull_request.number }}.tar.gz" + TXZ_KEY="pr-plugins/pr-${{ github.event.pull_request.number }}/webgui-pr-${{ github.event.pull_request.number }}-${VERSION}.tar.gz" PLUGIN_KEY="pr-plugins/pr-${{ github.event.pull_request.number }}/webgui-pr-${{ github.event.pull_request.number }}.plg" echo "version=$VERSION" >> $GITHUB_OUTPUT @@ -108,7 +109,7 @@ jobs: if: steps.changed-files.outputs.has_changes == 'true' id: upload-txz run: | - # Upload to R2 - overwrite existing file for updates + # Upload to R2 with versioned filename to prevent SHA conflicts aws s3 cp "webgui-pr-${{ github.event.pull_request.number }}.tar.gz" \ "s3://${{ secrets.CLOUDFLARE_PREVIEW_BUCKET_NAME }}/${{ steps.version.outputs.txz_key }}" \ --endpoint-url "${{ secrets.CLOUDFLARE_S3_URL }}" \