OctopusDeploy/push-build-information-action

BuildUrl is wrong

Closed this issue · 2 comments

context.payload.repository.url contains the api url for the repo, not the actual url. This currently generates dead urls like https://api.github.com/repos/{org}/{repo}/actions/runs/{runid}, instead of https://github.com/{org}/{repo}/actions/runs/{runid}

https://docs.github.com/en/rest/repos/repos#get-a-repository

const repoUri: string =
pushEvent?.repository?.url ||
`https://github.com/${context.repo.owner}/${context.repo.repo}`

According to the GitHub docs for the push event context.payload.repository.url is the HTML URL to the repository.

That's a mistake in the documentation. If you look at every other url and html_url property on that page you'll see that they are different. All endpoints that return a repository include the api url as url and the actual web url as html_url. Here's an example:
https://api.github.com/repos/Codertocat/Hello-World