Scroller animation #250
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR and Issue Response Bot | |
| on: | |
| pull_request: | |
| types: [opened, closed] # Trigger on both opened and closed PRs | |
| issues: | |
| types: [opened] | |
| jobs: | |
| auto-reply: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Post a comment for PRs and Issues | |
| - name: Post a comment | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| curl -X POST \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| -d '{"body":"Thank you for your pull request! We will review it shortly."}' \ | |
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"; | |
| elif [ "${{ github.event_name }}" = "issues" ]; then | |
| curl -X POST \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| -d '{"body":"Thank you for opening this issue! We will get back to you shortly."}' \ | |
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments"; | |
| fi | |
| # Step 2: Add Contributor on PR Merge | |
| - name: Add Contributor on PR Merge | |
| if: github.event.pull_request.merged == true # Only run if PR is merged | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| contributor=${{ github.event.pull_request.user.login }} # Get the PR author's username | |
| # Trigger the All Contributors bot to add the user as a contributor | |
| curl -X POST \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| -d "{\"body\":\"@all-contributors please add $contributor for code\"}" \ | |
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"; |