Skip to content

Auto-Comment on Nomination Issues #6

Auto-Comment on Nomination Issues

Auto-Comment on Nomination Issues #6

Workflow file for this run

name: "Auto-Comment on Nomination Issues"
on:
issues:
types: [opened]
jobs:
comment-on-issue:
runs-on: ubuntu-latest
steps:
- name: Add Welcome Comment for Nominations Only
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
const labels = issue.labels.map(label => label.name.toLowerCase());
// Only proceed if the issue has the "nomination" label
if (!labels.includes("nomination")) {
console.log("Skipping: Issue is not a nomination.");
return;
}
let programName = "Foundation Initiative Program";
let programDocs = "https://github.com/pytorch-fdn/foundation-initiative";
if (labels.includes("ambassador")) {
programName = "PyTorch Ambassador Program";
programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/pytorch-ambassador-program.md";
} else if (labels.includes("osp-outreach")) {
programName = "OSPO Outreach Program";
programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/osp-outreach.md";
} else if (labels.includes("speakers-bureau")) {
programName = "Speakers Bureau Program";
programDocs = "https://github.com/pytorch-fdn/foundation-initiative/blob/main/speakers-bureau.md";
}
const commentBody = `πŸ‘‹ Thank you for submitting a nomination for the **${programName}**! πŸŽ‰\n\n
Your nomination is currently under review. A team member will evaluate the submission and update the status accordingly.\n\n
πŸ”Ή **Next Steps:**\n
- If additional details are needed, we will comment here requesting more information.\n
- If approved, we will update the status to **"approved"** βœ… and contact you regarding the next steps.\n
- If the nomination does not meet the criteria, we will provide feedback and mark it as **"rejected"** ❌.\n\n
πŸ“– **Program Details & Requirements:** [Read More Here](${programDocs})\n\n
Please stay tuned and feel free to respond here if you have any questions. πŸš€`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: commentBody
});