Skip to content

Commit

Permalink
Merge pull request #1427 from near/feat/integrate-devtools-gh-project
Browse files Browse the repository at this point in the history
feat: adds issues and PRs to DevTools proejct
  • Loading branch information
thisisjoshford authored Nov 12, 2024
2 parents aba00c1 + b0e2bea commit 3782705
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/transfer-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Transfer Issues & PRs to DevTools Project

on:
issues:
types: [opened]

jobs:
transfer:
runs-on: ubuntu-latest
steps:
- name: Transfer Issue
uses: actions/github-script@v5
with:
github-token: ${{secrets.GH_TOKEN}}
script: |
const issueTitle = context.payload.issue.title;
const issueBody = context.payload.issue.body;
const issueNumber = context.payload.issue.number;
const organizationName = 'near';
const projectName = 'DevTools';
// Fetch project ID and other necessary IDs
const query = `
query {
organization(login: "${organizationName}") {
projectV2(number: 156) {
id
}
}
}
`;
const projectIdResponse = await github.graphql(query);
const projectId = projectIdResponse.organization.projectV2.id;
// 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, contentId: context.payload.issue.node_id });

0 comments on commit 3782705

Please sign in to comment.