Skip to content

Commit

Permalink
Resolve the problem, we need to use node_id not the direct ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni committed May 10, 2024
1 parent 45dceb4 commit c00dbdb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
18 changes: 8 additions & 10 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.

9 changes: 3 additions & 6 deletions src/project-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ import {mustGetOwnerTypeQuery, parseProjectName, parseProjectUrl} from './utils'
export async function projectLink(): Promise<void> {
const ownerType = mustGetOwnerTypeQuery(github.context.payload.repository?.owner.type)
const ownerName = github.context.payload.repository?.owner.login ?? ''
const ownerId = github.context.payload.repository?.owner.id ?? ''
const owner = github.context.payload.repository?.owner
const ownerId = github.context.payload.repository?.owner.node_id ?? ''

if (!ownerName || !ownerId || !owner) {
if (!ownerName || !ownerId) {
throw new Error('Could not determine repository owner')
}

core.debug(`Owner Object: \n ${JSON.stringify(owner, null, 2)}`)

const baseBranchPattern = core.getInput('base-branch-pattern') ?? '*'

const issue = github.context.payload.issue ?? github.context.payload.pull_request
Expand Down Expand Up @@ -83,7 +80,7 @@ export async function projectLink(): Promise<void> {
}
core.debug(`Template Project ID: ${templateProjectId}`)

projectId = await copyProjectTemplate({projectId: templateProjectId, title: projectName, ownerId: owner.node_id})
projectId = await copyProjectTemplate({projectId: templateProjectId, title: projectName, ownerId})
}

const addResp = await addIssueToProject({projectId, contentId, issueNumber: issue?.number})
Expand Down

0 comments on commit c00dbdb

Please sign in to comment.