Skip to content

Commit

Permalink
Add data to the end of URL and Project
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni committed Feb 18, 2024
1 parent b6c2b4f commit da3ab6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion 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: 6 additions & 3 deletions src/project-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ interface ProjectAddItemResponse {
addProjectV2ItemById: {
item: {
id: string
project: {
id: string
url: string
}
}
}
}
Expand Down Expand Up @@ -112,9 +116,6 @@ 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 @@ -290,6 +291,8 @@ export async function projectLink(): Promise<void> {

core.debug(`Add to Project Response: \n ${JSON.stringify(addResp, null, 2)}`)

core.info(`Pull Request: ${issue?.html_url}`)
core.info(`Project: ${addResp.addProjectV2ItemById.item.project.url}`)
core.setOutput('itemId', addResp.addProjectV2ItemById.item.id)
}

Expand Down

0 comments on commit da3ab6f

Please sign in to comment.