-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d42f1b
commit efb6780
Showing
1 changed file
with
14 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,22 @@ | ||
name: Transfer New Issue to DevRel Project Tracking | ||
name: 'Add to 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 = 'DevRel'; | ||
// 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 }} |