Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise ADR: Use the auth token to fetch the workflow repo #190

Closed
wants to merge 1 commit into from

Conversation

ericsciple
Copy link
Contributor

@ericsciple ericsciple commented Mar 19, 2020

Related to issue #183

@ericsciple ericsciple requested review from chrispat and thboop March 19, 2020 14:54
@@ -40,9 +40,12 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
default: ${{ github.token }}
ssh-key:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many actions take a dependency on auth being configured. So for the workflow repo, even after the initial fetch we need to leave the remote URL configured as HTTPS.

We could always add a separate input prefer-ssh to let users opt in to fetching the main repo using SSH. I worry a little bit about relative URLs.

Do we need to worry about LFS? I don't it affects this decision - using the token should be fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are adding extra inputs for this scenario we may want to consider having the inputs be opt in for users who need this functionality. It would be less entangled in the mainline scenario.

Its a bit verbose but we could do:
submodules-ssh-key
submodules-token
They would default to ssh-key or token.

This would enable us to work on any repo (not just the repo that kicked off the action). Users who don't need this scenario would ignore these inputs (and the consequences from them)

Copy link
Contributor

@thboop thboop Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many actions take a dependency on auth being configured. So for the workflow repo, even after the initial fetch we need to leave the remote URL configured as HTTPS.

We could do a pass on persist-credentials to state that ssh-config will only ever be set for submodules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're saying different things. This proposal changes the behavior for the main repo only ("the repository the workflow is running in").

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also i think it's ok to still configure the ssh command. Remotes that use HTTPS wont use it.

Copy link
Contributor Author

@ericsciple ericsciple Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. Separate inputs submodules-ssh-key and submodules-token makes more sense.

Reasons customers would want to use ssh key for the workflow repo:

  • Trigger additional run on push
  • Push a commit that edits the workflow file

@ericsciple ericsciple force-pushed the users/ericsciple/m167ssh branch from 58dbd86 to 3fcc310 Compare March 19, 2020 15:06
@ericsciple ericsciple changed the title Use auth token to fetch workflow repo Revise ADR: Use the auth token to fetch the workflow repo Mar 19, 2020


When fetching the repository the workflow is running in, the auth token will be used
and configured instead. This enables the SSH key to be used only for submodules.
Copy link
Contributor

@thboop thboop Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this defaulting to the token input (so it could be a user's PAT?) or the GitHub Token.

GitHub token expires after an hour, for long builds pushing changes after running tests we could see issues if we default to that.

Copy link
Contributor Author

@ericsciple ericsciple Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically could be the user's PAT; assumption it's the GitHub token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems uncommon to use PAT and SSH. The scenario here is, the main repo should just work even if SSH key doesnt have permission.

@ericsciple ericsciple closed this Apr 15, 2020
@ericsciple ericsciple deleted the users/ericsciple/m167ssh branch October 4, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants