Skip to content

Commit

Permalink
fix: update issue-transfer.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjoshford authored Nov 22, 2024
1 parent 578ad9a commit 41867eb
Showing 1 changed file with 14 additions and 39 deletions.
53 changes: 14 additions & 39 deletions .github/workflows/issue-transfer.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,22 @@
name: Transfer New Issue to Docs Project
name: 'Add to DevRel Project'

on:
issues:
types: [opened]
types:
- opened
- reopened
pull_request:
types:
- opened
- reopened

jobs:
transfer:
add-to-project:
name: Add issue/PR to project
runs-on: ubuntu-latest
steps:
- name: Transfer Issue
uses: actions/github-script@v5
- uses: actions/[email protected]
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 = 'NEAR Docs';
// Fetch project ID and other necessary IDs
const query = `
query {
organization(login: "${organizationName}") {
projectV2(number: 117) {
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 });
# add to DevRel Project #117
project-url: https://github.com/orgs/near/projects/117
github-token: ${{ secrets.GH_TOKEN }}

0 comments on commit 41867eb

Please sign in to comment.