Skip to content

Commit

Permalink
Extra debug and more info about payload
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni committed Feb 18, 2024
1 parent f0e54c6 commit b6c2b4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/project-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export async function projectLink(): Promise<void> {
const octokit = github.getOctokit(ghToken)

const issue = github.context.payload.issue ?? github.context.payload.pull_request

core.debug(`PR Payload: \n ${JSON.stringify(issue, null, 2)}`)

const issueLabels: string[] = (issue?.labels ?? []).map((l: {name: string}) => l.name.toLowerCase())
const issueOwnerName = github.context.payload.repository?.owner.login

Expand Down Expand Up @@ -184,7 +187,7 @@ export async function projectLink(): Promise<void> {
const contentId = issue?.node_id
core.debug(`Content ID: ${contentId}`)

const queryString = projectName // @todo replace this with the actual query string
const queryString = projectName
const getProjectsQuery = `query {
${ownerType}(login:"${issueOwnerName}") {
projectsV2(first:100 query:"${queryString}") {
Expand Down Expand Up @@ -263,7 +266,7 @@ export async function projectLink(): Promise<void> {
projectId = copyProjectTemplateResp.copyProjectV2.projectV2.id
}

core.info(`Adding issue ${issue?.number} to project ${projectId}`)
core.info(`Adding PR ${issue?.number} to project ${projectId}`)

const addResp = await octokit.graphql<ProjectAddItemResponse>(
`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
Expand Down

0 comments on commit b6c2b4f

Please sign in to comment.