Add Anil Sahu to Contributors.md #13
Workflow file for this run
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: Welcome New Contributors | |
| on: | |
| pull_request_target: | |
| types: [opened] | |
| issues: | |
| types: [opened] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| welcome: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Welcome new contributor | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const { owner, repo } = context.repo; | |
| if (context.eventName === 'pull_request_target') { | |
| const pr = context.payload.pull_request; | |
| const contributor = pr.user.login; | |
| // Check if this is the user's first PR in this repository | |
| const { data: prs } = await github.rest.pulls.list({ | |
| owner, | |
| repo, | |
| state: 'all', | |
| creator: contributor | |
| }); | |
| // If this is their first PR, welcome them | |
| if (prs.length === 1) { | |
| const message = `π **Welcome to First Contributions Practice!** π | |
| Thank you @${contributor} for your first contribution! | |
| Here's what happens next: | |
| 1. A maintainer will review your pull request | |
| 2. If everything looks good, we'll merge it | |
| 3. You'll officially be a contributor to this project! | |
| If this is your first time contributing to open source, congratulations! You're now part of the amazing open source community. π | |
| **Tips for future contributions:** | |
| - Look for repositories with "good first issue" labels | |
| - Read the contributing guidelines before making changes | |
| - Don't be afraid to ask questions | |
| - Keep learning and keep contributing! | |
| Thank you for being part of our learning community! π`; | |
| await github.rest.issues.createComment({ | |
| issue_number: pr.number, | |
| owner, | |
| repo, | |
| body: message | |
| }); | |
| } | |
| } | |
| if (context.eventName === 'issues') { | |
| const issue = context.payload.issue; | |
| const contributor = issue.user.login; | |
| // Check if this is the user's first issue in this repository | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner, | |
| repo, | |
| state: 'all', | |
| creator: contributor | |
| }); | |
| // If this is their first issue, welcome them | |
| if (issues.length === 1) { | |
| const message = `π **Hello @${contributor}!** | |
| Thank you for opening your first issue! We appreciate your feedback and contribution to making this project better. | |
| A maintainer will review your issue and respond soon. In the meantime: | |
| - Make sure you've provided all the necessary details | |
| - Check if there are any similar existing issues | |
| - Feel free to add more information if needed | |
| Thank you for helping us improve! π`; | |
| await github.rest.issues.createComment({ | |
| issue_number: issue.number, | |
| owner, | |
| repo, | |
| body: message | |
| }); | |
| } | |
| } |