From 682f26d30d97cf9d269b10582c754c13558b6426 Mon Sep 17 00:00:00 2001 From: Aniket Shinde Date: Wed, 8 Apr 2026 22:56:28 +0530 Subject: [PATCH 1/3] Updated release workflow to take the jira ticket --- .github/workflows/release.yml | 56 ++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e27bc8..c8a5b8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,10 @@ on: description: 'Branch to publish development releases' required: false type: string + jira_ticket: + description: 'Jira ticket ID (e.g. AST-12345)' + required: true + type: string workflow_dispatch: inputs: tag: @@ -21,6 +25,10 @@ on: description: 'Branch to publish development releases' required: false type: string + jira_ticket: + description: 'Jira ticket ID (e.g. AST-12345)' + required: true + type: string jobs: deleteDevReleases: @@ -118,23 +126,17 @@ jobs: git add .gitattributes git commit -m "Ensure LFS tracking for large JAR files" || echo "No changes to commit" - - name: Clone target repository and push changes + - name: Clone target repository and push changes via PR + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | - # Clone the repository git clone https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git update-site cd update-site - - # Ensure Git LFS is installed git lfs install - - # Configure Git user to prevent commit errors git config --global user.email "cylon-bot@checkmarx.com" git config --global user.name "cylon-bot" - - # Fetch all branches git fetch --all - # Ensure the branch exists and check it out if git show-ref --verify --quiet refs/remotes/origin/${{ env.GH_BRANCH_NAME }}; then echo "Branch ${{ env.GH_BRANCH_NAME }} exists remotely." git checkout -B ${{ env.GH_BRANCH_NAME }} origin/${{ env.GH_BRANCH_NAME }} @@ -143,36 +145,48 @@ jobs: exit 1 fi - # Debugging: List files in repository before copying - echo "===== Files in com.checkmarx.eclipse.site/target/repository/ BEFORE COPY =====" + # Create a feature branch + FEATURE_BRANCH="update-site/${{ env.GH_RELEASE_TAG_NAME }}" + git checkout -b "$FEATURE_BRANCH" + + echo "===== Files BEFORE COPY =====" ls -lh ../com.checkmarx.eclipse.site/target/repository/ - # Copy new files without deleting .git directory rsync -av --delete --exclude='.git' ../com.checkmarx.eclipse.site/target/repository/ ./ - # Debugging: List files in repository after copying - echo "===== Files in update-site/ AFTER COPY =====" + echo "===== Files AFTER COPY =====" ls -lh . - # Dynamically track all .jar files in the plugins/ and features/ directories find plugins -name "*.jar" -exec git lfs track {} + find features -name "*.jar" -exec git lfs track {} + - # Ensure .gitattributes is added git add .gitattributes git add . - # Debugging: Show LFS-tracked files echo "===== Git LFS-tracked files =====" git lfs ls-files - git commit -m "Update Eclipse update site for ${{ env.GH_RELEASE_TAG_NAME }}" || echo "No changes to commit" + git commit -m "Update Eclipse update site for ${{ env.GH_RELEASE_TAG_NAME }} (${{ inputs.jira_ticket }})" || echo "No changes to commit" - # Ensure the correct remote URL git remote set-url origin https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git - # Push changes - git push origin ${{ env.GH_BRANCH_NAME }} + # Push the feature branch + git push origin "$FEATURE_BRANCH" + + # Create PR with Jira ID at the end of the title + gh pr create \ + --repo CheckmarxDev/ast-eclipse-plugin-update-site \ + --base "${{ env.GH_BRANCH_NAME }}" \ + --head "$FEATURE_BRANCH" \ + --title "Update Eclipse update site for ${{ env.GH_RELEASE_TAG_NAME }} (${{ inputs.jira_ticket }})" \ + --body "Automated update of Eclipse update site for release ${{ env.GH_RELEASE_TAG_NAME }}." + + # Squash and merge the PR, then delete the branch + gh pr merge \ + --repo CheckmarxDev/ast-eclipse-plugin-update-site \ + --squash \ + --auto \ + --delete-branch From f71f10882f845ea758ec48f5d3a2d4eec35522b6 Mon Sep 17 00:00:00 2001 From: Aniket Shinde Date: Thu, 9 Apr 2026 12:33:08 +0530 Subject: [PATCH 2/3] Commented the merge to test --- .github/workflows/release.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8a5b8a..9207798 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -128,15 +128,23 @@ jobs: - name: Clone target repository and push changes via PR env: - GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + GH_TOKEN: ${{ secrets.ECLIPSE_SITE_TOKEN }} run: | - git clone https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git update-site + # Clone the repository + git clone https://x-access-token:${{ secrets.ECLIPSE_SITE_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git update-site cd update-site + + # Ensure Git LFS is installed git lfs install + + # Configure Git user to prevent commit errors git config --global user.email "cylon-bot@checkmarx.com" git config --global user.name "cylon-bot" + + # Fetch all branches git fetch --all + # Ensure the branch exists and check it out if git show-ref --verify --quiet refs/remotes/origin/${{ env.GH_BRANCH_NAME }}; then echo "Branch ${{ env.GH_BRANCH_NAME }} exists remotely." git checkout -B ${{ env.GH_BRANCH_NAME }} origin/${{ env.GH_BRANCH_NAME }} @@ -152,23 +160,29 @@ jobs: echo "===== Files BEFORE COPY =====" ls -lh ../com.checkmarx.eclipse.site/target/repository/ + # Copy new files without deleting .git directory rsync -av --delete --exclude='.git' ../com.checkmarx.eclipse.site/target/repository/ ./ + # Debugging: List files in repository after copying echo "===== Files AFTER COPY =====" ls -lh . + # Dynamically track all .jar files in the plugins/ and features/ directories find plugins -name "*.jar" -exec git lfs track {} + find features -name "*.jar" -exec git lfs track {} + + # Ensure .gitattributes is added git add .gitattributes git add . + # Debugging: Show LFS-tracked files echo "===== Git LFS-tracked files =====" git lfs ls-files git commit -m "Update Eclipse update site for ${{ env.GH_RELEASE_TAG_NAME }} (${{ inputs.jira_ticket }})" || echo "No changes to commit" - git remote set-url origin https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git + # Ensure the correct remote URL + git remote set-url origin https://x-access-token:${{ secrets.ECLIPSE_SITE_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git # Push the feature branch git push origin "$FEATURE_BRANCH" @@ -182,11 +196,11 @@ jobs: --body "Automated update of Eclipse update site for release ${{ env.GH_RELEASE_TAG_NAME }}." # Squash and merge the PR, then delete the branch - gh pr merge \ - --repo CheckmarxDev/ast-eclipse-plugin-update-site \ - --squash \ - --auto \ - --delete-branch + # gh pr merge \ + # --repo CheckmarxDev/ast-eclipse-plugin-update-site \ + # --squash \ + # --auto \ + # --delete-branch From 87c1e78ce511f20253ba3cb7a6d00fad1c5f4be5 Mon Sep 17 00:00:00 2001 From: Aniket Shinde Date: Thu, 9 Apr 2026 12:57:13 +0530 Subject: [PATCH 3/3] Un commented the merge to test --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9207798..07a13d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -196,11 +196,11 @@ jobs: --body "Automated update of Eclipse update site for release ${{ env.GH_RELEASE_TAG_NAME }}." # Squash and merge the PR, then delete the branch - # gh pr merge \ - # --repo CheckmarxDev/ast-eclipse-plugin-update-site \ - # --squash \ - # --auto \ - # --delete-branch + gh pr merge \ + --repo CheckmarxDev/ast-eclipse-plugin-update-site \ + --squash \ + --auto \ + --delete-branch