Skip to content

[Nomination] <Nominee Name> #801

[Nomination] <Nominee Name>

[Nomination] <Nominee Name> #801

name: "Transfer Approved Submission to Private Repo"
on:
issues:
types: [labeled]
jobs:
transfer-submission:
if: github.event.label.name == 'approved'
runs-on: ubuntu-latest
steps:
- name: Transfer Issue to Private Repo
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PRIVATE_REPO_TOKEN }}
script: |
const issue = context.payload.issue;
const repoOwner = context.repo.owner;
const publicRepo = context.repo.repo;
const privateRepo = "foundation-programs-management";
const assignee = "reginankenchor";
const bodyContent = [
"πŸ“ Submission Transferred from Public Repository",
"",
"----------------------------------------",
issue.body,
"----------------------------------------",
`πŸ”” @${assignee} β€” this submission has been approved and is now ready for program-level follow-up.`
].join("\n\n");
const newIssue = await github.rest.issues.create({
owner: repoOwner,
repo: privateRepo,
title: issue.title,
body: bodyContent,
assignees: [assignee]
});
const confirmation = [
"βœ… This submission has been approved and transferred to the private program management repository.",
"",
`πŸ”— [View it here](${newIssue.data.html_url})`,
"",
"This issue has been closed here for tracking purposes."
].join("\n\n");
await github.rest.issues.createComment({
owner: repoOwner,
repo: publicRepo,
issue_number: issue.number,
body: confirmation
});
await github.rest.issues.update({
owner: repoOwner,
repo: publicRepo,
issue_number: issue.number,
state: "closed"
});