diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 273b45e..0000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Greetings - -on: [pull_request_target, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: "👋 Hey there, rockstar! Thanks for dropping an issue! The Museum team is on it like pineapple on pizza (love it or hate it). Stick around, magic's about to happen!" - pr-message: "🎉 Boom! Your pull request just flew into the Museum HQ. High fives all around! Our team of tech wizards will check it out and get back to you faster than you can say 'code ninja!' Thanks for leveling up the project!" diff --git a/.github/workflows/issue-open-close.yml b/.github/workflows/issue-open-close.yml new file mode 100644 index 0000000..eb27323 --- /dev/null +++ b/.github/workflows/issue-open-close.yml @@ -0,0 +1,29 @@ + +name: Issue Auto Comment +on: + issues: + types: [opened, closed] + +jobs: + comment: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add a comment when an issue is opened + if: github.event.action == 'opened' + uses: actions-ecosystem/action-create-comment@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + number: ${{ github.event.issue.number }} + body: | + 👋 Thanks for opening this issue! We appreciate your contribution. Please make sure you’ve provided all the necessary details and screenshots, and don't forget to follow our Guidelines and Code of Conduct. Happy coding! 🚀 + + - name: Add a comment when an issue is closed + if: github.event.action == 'closed' + uses: actions-ecosystem/action-create-comment@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + number: ${{ github.event.issue.number }} + body: | + ✅ This issue has been successfully closed. Thank you for your contribution and helping us improve the project! If you have any more ideas or run into other issues, feel free to open a new one. Happy coding! 🚀 diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml new file mode 100644 index 0000000..5eea0ca --- /dev/null +++ b/.github/workflows/pr-merge.yml @@ -0,0 +1,35 @@ + +name: Merge Thank You + + + +on: + pull_request_target: + types: [closed] # Trigger when a PR is closed + +permissions: + issues: write + pull-requests: write + +jobs: + post_merge_message: + if: github.event.pull_request.merged == true # Only run if the PR was merged + runs-on: ubuntu-latest + + steps: + - name: Post thank you message + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # Ensure token is used + 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..92439f9 --- /dev/null +++ b/.github/workflows/pr-raise.yml @@ -0,0 +1,40 @@ + + +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 <