|
| 1 | + |
1 | 2 | name: "Auto-Comment on Nomination Issues" |
2 | 3 | on: |
3 | 4 | issues: |
|
7 | 8 | comment-on-issue: |
8 | 9 | runs-on: ubuntu-latest |
9 | 10 | steps: |
10 | | - - name: Add Welcome Comment for Nominations Only |
| 11 | + - name: Add Welcome Comment Based on Program |
11 | 12 | uses: actions/github-script@v6 |
12 | 13 | with: |
13 | 14 | github-token: ${{ secrets.GITHUB_TOKEN }} |
14 | 15 | script: | |
15 | 16 | const issue = context.payload.issue; |
16 | 17 | const labels = issue.labels.map(label => label.name.toLowerCase()); |
| 18 | + const issueNumber = issue.number; |
| 19 | + const repoOwner = context.repo.owner; |
| 20 | + const repoName = context.repo.repo; |
17 | 21 |
|
18 | | - // Only proceed if the issue has the "nomination" label |
19 | | - if (!labels.includes("nomination")) { |
20 | | - console.log("Skipping: Issue is not a nomination."); |
21 | | - return; |
22 | | - } |
23 | | -
|
24 | | - let programName = "PyTorch Foundation Programs"; |
| 22 | + let programName = "PyTorch Foundation Program"; |
25 | 23 | let programDocs = "https://github.com/pytorch-fdn/foundation-programs"; |
| 24 | + let commentBody = ""; |
26 | 25 |
|
27 | 26 | if (labels.includes("ambassador")) { |
28 | 27 | programName = "PyTorch Ambassador Program"; |
29 | | - programDocs = "https://github.com/pytorch-fdn/foundation-programs/blob/main/pytorch-ambassador-program.md"; |
30 | | - } else if (labels.includes("ospo-outreach")) { |
31 | | - programName = "OSPO Outreach Program"; |
32 | | - programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/osp-outreach.md"; |
| 28 | + programDocs = "https://github.com/pytorch-fdn/foundation-programs/blob/main/ambassador/README.md"; |
| 29 | + commentBody = [ |
| 30 | + `π Thank you for submitting a nomination for the **${programName}**! π`, |
| 31 | + "", |
| 32 | + "Your nomination is currently under review. A team member will evaluate the submission and update the status accordingly.", |
| 33 | + "", |
| 34 | + "πΉ **Review Process & Next Steps:**", |
| 35 | + "1οΈβ£ Initial Review β The nomination will be reviewed by the team.", |
| 36 | + "2οΈβ£ One-on-One Review β If shortlisted, the nominee will have a session with the Executive Director.", |
| 37 | + "3οΈβ£ Ranking & Selection β Reviewers will assign scores based on eligibility and impact.", |
| 38 | + "4οΈβ£ Final Decision β Selected ambassadors will receive an **official invitation**. β
", |
| 39 | + "", |
| 40 | + `π Program Details: [View Documentation](${programDocs})`, |
| 41 | + "", |
| 42 | + "π¬ Have questions? Please submit a [Feedback or Inquiry](https://github.com/pytorch-fdn/foundation-initiative/issues/new?template=feedback.yml) and reference this nomination issue number.", |
| 43 | + "", |
| 44 | + "Thank you for helping grow the PyTorch community! π" |
| 45 | + ].join("\n\n"); |
33 | 46 | } else if (labels.includes("speakers-bureau")) { |
34 | 47 | programName = "Speakers Bureau Program"; |
35 | | - programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/speakers-bureau.md"; |
| 48 | + programDocs = "https://github.com/pytorch-fdn/foundation-programs/blob/main/speakers-bureau/README.md"; |
| 49 | + commentBody = [ |
| 50 | + `π Thank you for submitting a nomination for the **${programName}**! π€`, |
| 51 | + "", |
| 52 | + "Your nomination is currently being reviewed. A team member will evaluate the speakerβs background, proposed topics, and fit for upcoming events.", |
| 53 | + "", |
| 54 | + `π Program Details: [View Documentation](${programDocs})`, |
| 55 | + "", |
| 56 | + "π¬ Have questions? Please submit a [Feedback or Inquiry](https://github.com/pytorch-fdn/foundation-initiative/issues/new?template=feedback.yml) and reference this issue.", |
| 57 | + "", |
| 58 | + "We appreciate your effort to support PyTorch education and visibility worldwide! π" |
| 59 | + ].join("\n\n"); |
| 60 | + } else if (labels.includes("ospo-outreach")) { |
| 61 | + programName = "OSPO Outreach Program"; |
| 62 | + programDocs = "https://github.com/pytorch-fdn/foundation-programs/blob/main/ospo-outreach/README.md"; |
| 63 | + commentBody = [ |
| 64 | + `π Thank you for your submission to the **${programName}**! π§ͺ`, |
| 65 | + "", |
| 66 | + "Your outreach proposal is under review. The team will evaluate the research goals, scope, and alignment with PyTorch Foundation priorities.", |
| 67 | + "", |
| 68 | + `π Program Details: [View Documentation](${programDocs})`, |
| 69 | + "", |
| 70 | + "π¬ Have questions? Please submit a [Feedback or Inquiry](https://github.com/pytorch-fdn/foundation-initiative/issues/new?template=feedback.yml) and reference this issue.", |
| 71 | + "", |
| 72 | + "Thank you for advancing open-source AI and ML innovation with us! π€" |
| 73 | + ].join("\n\n"); |
| 74 | + } else { |
| 75 | + commentBody = [ |
| 76 | + `π Thank you for submitting to the **${programName}**!`, |
| 77 | + "", |
| 78 | + `Your submission is under review. Please refer to our [documentation](${programDocs}) for next steps.`, |
| 79 | + "", |
| 80 | + "If you have questions, submit a [Feedback Issue](https://github.com/pytorch-fdn/foundation-initiative/issues/new?template=feedback.yml) and include this issue number." |
| 81 | + ].join("\n\n"); |
36 | 82 | } |
37 | 83 |
|
38 | | - const commentBody = `π Thank you for submitting a nomination for the **${programName}**! π\n\n |
39 | | - Your nomination is currently under review. A team member will evaluate the submission and update the status accordingly.\n\n |
40 | | - πΉ **Review Process & Next Steps:**\n |
41 | | - 1οΈβ£ **Initial Review** - The nomination will be reviewed by the team. |
42 | | - 2οΈβ£ **One-on-One Review** - If shortlisted, the nominee will have a session with the Executive Director. |
43 | | - 3οΈβ£ **Ranking & Selection** - Nominees will be ranked based on eligibility & impact. |
44 | | - 4οΈβ£ **Final Decision** - Selected ambassadors will receive an **official invitation**. β
\n\n |
45 | | - π **Program Details & Requirements:** [Read More Here](https://github.com/pytorch-fdn/foundation-programs/blob/main/pytorch-ambassador-program.md)\n\n |
46 | | - π¬ **Have questions about your nomination?** |
47 | | - Please submit a [Feedback or Inquiry](https://github.com/pytorch-fdn/foundation-initiative/issues/new?template=feedback.yml) and reference this issue number in the description. |
48 | | - This helps us keep nomination threads focused on the review process. π\n\n |
49 | | - Thank you for helping grow the PyTorch community! π`; |
50 | | -
|
51 | 84 | await github.rest.issues.createComment({ |
52 | | - owner: context.repo.owner, |
53 | | - repo: context.repo.repo, |
54 | | - issue_number: issue.number, |
| 85 | + owner: repoOwner, |
| 86 | + repo: repoName, |
| 87 | + issue_number: issueNumber, |
55 | 88 | body: commentBody |
56 | 89 | }); |
57 | | -
|
|
0 commit comments