-
Notifications
You must be signed in to change notification settings - Fork 14
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
001d079
commit dade913
Showing
2 changed files
with
46 additions
and
0 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 |
---|---|---|
@@ -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.