Skip to content

Commit

Permalink
add issue transfer to docs project
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjoshford committed May 10, 2024
1 parent 001d079 commit dade913
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/issue-transfer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Transfer New Issue to Docs Project

on:
issues:
types: [opened]

jobs:
transfer:
runs-on: ubuntu-latest
steps:
- name: Transfer Issue
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: script: |
const issueTitle = context.payload.issue.title;
const issueBody = context.payload.issue.body;
const issueNumber = context.payload.issue.number;
const organizationName = 'near';
const projectName = 'NEAR Docs';

// Fetch project ID and other necessary IDs
const query = `
query {
organization(login: "${organization\$rg}") {
projectV2(number: 117) {
id
}
}
}
`;
const projectId = await github.graphql(query);
// Add issue to the project
const mutation = `
mutation($projectId: ID!, $contentId: ID!) {
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
item {
id
}
}
}
`;
await github.graphql(mutation, { projectId: projectId.organization.projectV2.id, contentId: context.payload.issue.node_id });
Empty file added .github/workflows
Empty file.

0 comments on commit dade913

Please sign in to comment.