|
| 1 | +name: "Auto-Comment on Nomination Issues" |
| 2 | +on: |
| 3 | + issues: |
| 4 | + types: [opened] |
| 5 | + |
| 6 | +jobs: |
| 7 | + comment-on-issue: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Add Welcome Comment Based on Program |
| 11 | + uses: actions/github-script@v6 |
| 12 | + with: |
| 13 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 14 | + script: | |
| 15 | + const issue = context.payload.issue; |
| 16 | + const labels = issue.labels.map(label => label.name.toLowerCase()); |
| 17 | +
|
| 18 | + let programName = "Foundation Initiative Program"; |
| 19 | + let programDocs = "https://github.com/pytorch-fdn/foundation-initiative"; |
| 20 | +
|
| 21 | + if (labels.includes("ambassador")) { |
| 22 | + programName = "PyTorch Ambassador Program"; |
| 23 | + programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/pytorch-ambassador-program.md"; |
| 24 | + } else if (labels.includes("osp-outreach")) { |
| 25 | + programName = "OSPO Outreach Program"; |
| 26 | + programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/osp-outreach.md"; |
| 27 | + } else if (labels.includes("speakers-bureau")) { |
| 28 | + programName = "Speakers Bureau Program"; |
| 29 | + programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/speakers-bureau.md"; |
| 30 | + } |
| 31 | +
|
| 32 | + const commentBody = `π Thank you for submitting a nomination for the **${programName}**! π\n\n |
| 33 | + Your nomination is currently under review. A team member will evaluate the submission and update the status accordingly.\n\n |
| 34 | + πΉ **Next Steps:**\n |
| 35 | + - If additional details are needed, we will comment here requesting more information.\n |
| 36 | + - If approved, we will update the status to **"approved"** β
we will contact you regarding the next steps.\n |
| 37 | + - If the nomination does not meet the criteria, we will provide feedback and mark it as **"rejected"** β.\n\n |
| 38 | + π **Program Details & Requirements:** [Read More Here](${programDocs})\n\n |
| 39 | + Please stay tuned and feel free to respond here if you have any questions. π`; |
| 40 | +
|
| 41 | + await github.rest.issues.createComment({ |
| 42 | + owner: context.repo.owner, |
| 43 | + repo: context.repo.repo, |
| 44 | + issue_number: issue.number, |
| 45 | + body: commentBody |
| 46 | + }); |
0 commit comments