This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-intellij-plugin.git


The following commit(s) were added to refs/heads/main by this push:
     new 221b798  feat(ci): add artifact download for PR builds (#30)
221b798 is described below

commit 221b7986702ed3beeff5b42e153cbf8785e986ac
Author: Lukasz Lenart <[email protected]>
AuthorDate: Sat Jan 10 20:04:03 2026 +0100

    feat(ci): add artifact download for PR builds (#30)
    
    * feat(ci): add artifact download for PR builds
    
    - Add artifact preparation and upload steps to build job
    - Add sticky PR comment with download link to artifacts
    - Enables reviewers to test plugin without building locally
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <[email protected]>
    
    * fix(ci): replace third-party action with actions/github-script
    
    Replace marocchino/sticky-pull-request-comment with actions/github-script
    to comply with Apache's requirement that all actions must be from
    approved repositories (GitHub-owned actions are allowed).
    
    The sticky comment behavior is preserved using a hidden HTML marker
    to find and update existing comments.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <[email protected]>
    
    ---------
    
    Co-authored-by: Claude <[email protected]>
---
 .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 00c006b..e0362ca 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -81,6 +81,62 @@ jobs:
       - name: Build plugin
         run: ./gradlew buildPlugin
 
+      # Prepare plugin archive content for creating artifact
+      - name: Prepare Plugin Artifact
+        id: artifact
+        shell: bash
+        run: |
+          cd ${{ github.workspace }}/build/distributions
+          FILENAME=`ls *.zip`
+          unzip "$FILENAME" -d content
+          echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
+
+      # Store already-built plugin as an artifact for downloading
+      - name: Upload artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: ${{ steps.artifact.outputs.filename }}
+          path: ./build/distributions/content/*/*
+
+      # Comment on PR with artifact download link (sticky comment - updates 
existing)
+      - name: Comment PR with artifact link
+        if: github.event_name == 'pull_request'
+        uses: actions/github-script@v7
+        with:
+          script: |
+            const marker = '<!-- plugin-artifact-comment -->';
+            const body = `${marker}
+            🔌 **Plugin artifact ready for testing!**
+
+            Download from [Actions artifacts](${{ github.server_url }}/${{ 
github.repository }}/actions/runs/${{ github.run_id }}#artifacts)
+
+            Artifact: \`${{ steps.artifact.outputs.filename }}\``;
+
+            // Find existing comment with marker
+            const { data: comments } = await github.rest.issues.listComments({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              issue_number: context.issue.number
+            });
+
+            const existing = comments.find(c => c.body.includes(marker));
+
+            if (existing) {
+              await github.rest.issues.updateComment({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                comment_id: existing.id,
+                body: body
+              });
+            } else {
+              await github.rest.issues.createComment({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                issue_number: context.issue.number,
+                body: body
+              });
+            }
+
 
   # Run tests and upload a code coverage report
   test:

Reply via email to