From 8dd7d22a541b5199c1b2a5bf321c237c46fb719a Mon Sep 17 00:00:00 2001 From: Siddheya Kulkarni <115717746+Asymtode712@users.noreply.github.com> Date: Tue, 21 May 2024 17:12:02 +0530 Subject: [PATCH 1/2] created autocomment-pr-merge.yml --- .github/workflows/autocomment-pr-merge.yml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/autocomment-pr-merge.yml diff --git a/.github/workflows/autocomment-pr-merge.yml b/.github/workflows/autocomment-pr-merge.yml new file mode 100644 index 0000000..4cfa48d --- /dev/null +++ b/.github/workflows/autocomment-pr-merge.yml @@ -0,0 +1,36 @@ +name: Auto Comment on PR Merge + +on: + pull_request: + types: [closed] + +permissions: + issues: write + pull-requests: write + +jobs: + comment: + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: github.event.pull_request.merged == true + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Add Comment to Issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + COMMENT=$(cat < Date: Thu, 23 May 2024 02:45:16 +0530 Subject: [PATCH 2/2] Update autocomment-pr-merge.yml --- .github/workflows/autocomment-pr-merge.yml | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/autocomment-pr-merge.yml b/.github/workflows/autocomment-pr-merge.yml index 4cfa48d..ce2b228 100644 --- a/.github/workflows/autocomment-pr-merge.yml +++ b/.github/workflows/autocomment-pr-merge.yml @@ -1,36 +1,37 @@ -name: Auto Comment on PR Merge +name: Auto Comment on PR Merge # Name of the GitHub Action workflow on: pull_request: - types: [closed] + types: [closed] # Trigger the workflow when a pull request is closed permissions: - issues: write - pull-requests: write + issues: write # Grant permission to write to issues + pull-requests: write # Grant permission to write to pull requests jobs: comment: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Use the latest Ubuntu runner for the job permissions: - pull-requests: write - if: github.event.pull_request.merged == true + pull-requests: write # Grant permission to write to pull requests for this job specifically + if: github.event.pull_request.merged == true # Only run this job if the pull request was merged steps: - - name: Checkout Repository - uses: actions/checkout@v2 + - name: Checkout Repository # Step to checkout the repository + uses: actions/checkout@v2 # Use the GitHub action to checkout the repository code - - name: Add Comment to Issue + - name: Add Comment to Issue # Step to add a comment to the merged pull request env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the GitHub token stored in secrets for authentication run: | - COMMENT=$(cat <