mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-06 06:29:45 -06:00
chore: fix action to properly add PR to the Triage Board for visibility (#27917)
This commit is contained in:
@@ -20,6 +20,32 @@ const createPullRequest = async ({ context, github, baseBranch, branchName, desc
|
||||
|
||||
//add to firewatch board
|
||||
if (addToProjectBoard) {
|
||||
const getProjectV2NodeIdQuery = `
|
||||
query ($org: String!, $project_id: Int!, $repo: String!, $issueNumber: Int!) {
|
||||
organization(login: $org) {
|
||||
projectV2(number: $project_id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
repository(owner: $org, name: $repo) {
|
||||
pullRequest(number: $issueNumber) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
const getProjectV2NodeIdQueryVars = {
|
||||
org: context.repo.owner,
|
||||
project_id: 9,
|
||||
repo: context.repo.repo,
|
||||
issueNumber: number,
|
||||
}
|
||||
|
||||
let projectBoardNodeId = await github.graphql(
|
||||
getProjectV2NodeIdQuery,
|
||||
getProjectV2NodeIdQueryVars,
|
||||
)
|
||||
|
||||
const addToProjectBoardQuery = `
|
||||
mutation ($project_id: ID!, $item_id: ID!) {
|
||||
addProjectV2ItemById(input: {contentId: $item_id, projectId: $project_id}) {
|
||||
@@ -31,8 +57,8 @@ const createPullRequest = async ({ context, github, baseBranch, branchName, desc
|
||||
}`
|
||||
|
||||
const addToProjectBoardQueryVars = {
|
||||
project_id: 9,
|
||||
item_id: number,
|
||||
project_id: projectBoardNodeId.organization.projectV2.id,
|
||||
item_id: projectBoardNodeId.repository.pullRequest.id,
|
||||
}
|
||||
|
||||
await github.graphql(
|
||||
|
||||
Reference in New Issue
Block a user