action.yml: Configure git to use HTTPS for GitHub repos#388
action.yml: Configure git to use HTTPS for GitHub repos#388thomasheritage wants to merge 4 commits intomainfrom
Conversation
build.mjs runs a number of git commands including cloning repos (and their submodules). Any operation using SSH fails because SSH is not configured on the runner. For example, submodules might be configured using SSH (with "git@github.com" in ".gitmodules"). This commit configures git so that all uses of SSH for GitHub repos are automatically replaced with HTTPS. This is comparable to the behaviour of https://github.com/actions/checkout which notes "When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS" This is added to action.yml rather than to build.mjs because it aims to configure the runner environment -- if build.mjs is run in other contexts (e.g. local machine) then a different configuration might be needed.
|
Note that this will fix problems I'm actively having with redlines on ST 2067-206 as part of comment resolution |
I'll close this PR after chatting with Thomas directly, as per our discussion. |
|
Thanks for looking into this. Apologies, there might have been a bit of misunderstanding here because the discussion has been split between GitHub and email. This PR ensures that git on the runner is configured so that it's robust against the protocol used when referring to git repos on GitHub -- that is, if SSH is used to refer to a repo (which will fail) it simply uses HTTPS instead (which will work). For example, if This is useful because in the repo for ST 2067-206 I set @SteveLLamb thanks for the updates you've made to https://github.com/SMPTE/st2067-206-private. However, there is still a problem. In the PR "20260202 CD" (at https://github.com/SMPTE/st2067-206-private/pull/34) the step "Generating a redline against the latest edition tag: 20260202-wd" still fails (see https://github.com/SMPTE/st2067-206-private/actions/runs/23219441818/job/67488414326#step:6:659) because in that tagged release the (As an aside: note that although "Generating a redline against the latest edition tag: 20260202-wd" failed and there's no link to it in the post by the github-actions bot on the 2067-206 PR (see https://github.com/SMPTE/st2067-206-private/pull/34#issuecomment-4011917610) it was previously generated successfully (because I updated the "tooling" submodule to use the branch referenced by this html-pub PR) and is still accessible at https://doc.smpte-doc.org/st2067-206-private/20260202-cd1/pub-rl.html. I've emailed this link to people. This is dangerous because this redline is now out-of-sync with the other assets at https://doc.smpte-doc.org/st2067-206-private/20260202-cd1/ because of the S3 issue covered at #360) I believe that the change made in this PR is (roughly) equivalent to the approach taken by the official This PR would solve the issue I'm having with 2067-206, and make html-pub more robust. Is there be a downside? Is there an alternative fix to the issues I'm having with 2067-206 that would be preferable? |
|
Note that the "base-rl.html" redline is being generated on https://github.com/SMPTE/st2067-206-private/pull/34 and it's basically the same as "pub-rl.html" (that isn't being generated at the moment) so people reviewing recent changes can just use that one for now. However, there will be a problem once #394 is merged because redline failure will then (sensibly) cause the whole build job to fail. |
|
@thomasheritage OH! I see the issue clearly now. There are 2 redlines avail:
This we know. Now your issue:
That was because the tag is fetched only at PR create build and stored, not each PR commit build (the root issue). There is no current I'll make this update as part of the force fail PR at #394 ,as it's related. |
Is that correct? Both redlines were produced correctly on https://github.com/SMPTE/st2067-206-private/pull/34/changes/e4d6d2be759b335c4c4c15865990404675b33abb when I switched to my branch of html-pub (that has the SSH/HTTPS fix). From the Action logs the error I am having is due to not being able to clone html-pub using SSH per https://github.com/SMPTE/st2067-206-private/actions/runs/23219441818/job/67488414326#step:6:659 : |
|
Nope, the root issue is the release having the updated |
build.mjs runs a number of git commands including cloning repos (and their submodules). Any operation using SSH fails because SSH is not configured on the runner. For example, submodules might be configured using SSH (with "git@github.com" in ".gitmodules").
This commit configures git so that all uses of SSH for GitHub repos are automatically replaced with HTTPS. This is comparable to the behaviour of https://github.com/actions/checkout which notes "When the
ssh-keyinput is not provided, SSH URLs beginning withgit@github.com:are converted to HTTPS"This is added to action.yml rather than to build.mjs because it aims to configure the runner environment -- if build.mjs is run in other contexts (e.g. local machine) then a different configuration might be needed.