From 198ea27fe608ef73e214d9241ad66d938d92024d Mon Sep 17 00:00:00 2001 From: satwik-miyyapuram-cohesity <141320330+satwik-miyyapuram-cohesity@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:54:53 +0530 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85f9e63d..36bf3fd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,9 @@ -name: Create Pull Request for Last Commit +name: Create Pull Request for Last Commit on Any Branch on: push: branches: - - 'A' # Replace 'A' with your branch name + - '*' # Trigger on any branch jobs: create_pr: @@ -13,11 +13,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Get last commit SHA + - name: Get last commit SHA (Commit 1) id: commit1 run: echo "::set-output name=sha1::$(git rev-parse HEAD~1)" - - name: Get current commit SHA + - name: Get current commit SHA (Commit 2) id: commit2 run: echo "::set-output name=sha2::$(git rev-parse HEAD)" @@ -25,10 +25,14 @@ jobs: uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "Automated Pull Request for Commit 2" - base: ${{ github.ref_name }} # The current branch (A) + commit-message: "Automated Pull Request for new commit" + base: ${{ github.ref_name }} # The current branch name head: ${{ steps.commit1.outputs.sha1 }} # Commit 1 compare-to: ${{ steps.commit2.outputs.sha2 }} # Commit 2 - title: "CR for Commit 1 vs Commit 2" + title: "CR: Compare Commit 1 vs Commit 2" body: | - This pull request is between Commit 1 (SHA: ${{ steps.commit1.outputs.sha1 }}) and Commit 2 (SHA: ${{ steps.commit2.outputs.sha2 }}) + This pull request is automatically created to compare: + - **Commit 1 (SHA: ${{ steps.commit1.outputs.sha1 }})** and + - **Commit 2 (SHA: ${{ steps.commit2.outputs.sha2 }})** + reviewers: "" # Optionally add reviewers + labels: "auto-generated" # Optionally add labels