scientific-python / circleci-artifacts-redirector-action

GitHub Action to add a GitHub status link to a CircleCI artifact.
MIT License
14 stars 8 forks source link

Broken link when PR source repo has CircleCI enabled #7

Open QuLogic opened 4 years ago

QuLogic commented 4 years ago

Looking at the source, it seems like you use payload.repository.id in the domain name for links. That ID seems to point to the target repo. The way CircleCI works is to build a head commit, not a merge, so the target doesn't matter. If the source repo also has CircleCI enabled, then the build is not run again for the PR. The domain name then has the ID of the source repository.

For example, in this PR, the link from the Action is posted as: https://31997-1385122-gh.circle-artifacts.com/0/doc/build/html/index.html i.e., repository ID = 1385122, but navigating through the build, the link should be: https://13144-7439715-gh.circle-artifacts.com/0/doc/build/html/index.html with repository ID = 7439715, which corresponds with the source repo.

I don't know if this information is exposed somehow in the payload.

larsoner commented 4 years ago

@QuLogic I also do not know. This is also probably a dup of https://github.com/larsoner/circleci-artifacts-redirector/issues/6 (though that version of this project is more or less deprecated). Any help figuring it out / making a PR is appreciated, my knowledge is limited here...

larsoner commented 4 years ago

If it would help, a first step might be to log the payload itself when actually making the link. That would tell you if there was something in there that could be used to fix it. Then a second PR could be made to actually make the correction.