diff --git a/.github/workflows/pr_merge.yml b/.github/workflows/pr_merge.yml new file mode 100644 index 0000000..6221071 --- /dev/null +++ b/.github/workflows/pr_merge.yml @@ -0,0 +1,32 @@ +name: Merge Thank You + +on: + pull_request_target: + types: [closed] + +permissions: + issues: write + pull-requests: write + +jobs: + post_merge_message: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Post thank you message + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prNumber = context.payload.pull_request.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + + // Post a thank you message upon PR merge + await github.rest.issues.createComment({ + owner: owner, + repo: repo, + issue_number: prNumber, + body: `🎉🎉 Thank you for your contribution! Your PR #${prNumber} has been merged! 🎉🎉` + }); diff --git a/.github/workflows/pr_raise.yml b/.github/workflows/pr_raise.yml new file mode 100644 index 0000000..b94eb1b --- /dev/null +++ b/.github/workflows/pr_raise.yml @@ -0,0 +1,37 @@ +name: Auto Comment on PR + +on: + pull_request_target: + types: [opened] + +permissions: + issues: write + pull-requests: write + +jobs: + comment: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Add Comment to Pull Request + run: | + COMMENT=$(cat <