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

allow custom author #26

Closed

Conversation

yelizariev
Copy link
Contributor

Updates:

  • Move token to inputs
  • add two args: commit_author_name, commit_author_email'
  • merge notion "commiter" and "author" for sake of settings simplicity
  • entrypoints args are not used, so delete it

Motivation:

default token has limitations. For example, it doesn't trigger deployment of Github Pages. The solution is using a custom token. But it doesn't work without changing the committer email. But as we change committer, it makes sense to change the author too.

Tested here:

@stefanzweifel
Copy link
Owner

Thanks for the PR. I will take a closer look over the next couple of days.

@yelizariev
Copy link
Contributor Author

It seems that triggering github pages doesn't work anyway.

I tried here: https://github.com/it-projects-llc/shhvshhshhshh-rukovodstvo-polzovatelia/blob/12.0/.github/workflows/rebuild.yml
Even with extra commit: yelizariev@4de4615

In another project the idea does work with another action, which use another authentication. Details:

@yelizariev
Copy link
Contributor Author

This update could be added too yelizariev@2ab971c

@yelizariev
Copy link
Contributor Author

Some information can be found here: maxheld83/ghpages#18

They also use that way of authentication

REMOTE_REPO="https://${GH_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${GITHUB_REPOSITORY}.git" && \

@stefanzweifel what do you think about switching to that authentication? Shall I update my PR or you can try and make updates yourself?

@yelizariev
Copy link
Contributor Author

Another reason to use custom token: branch may be protected for pushing without checks. In that case, we may create a token with admin access. Apparently, the current version doesn't work in this case too

@stefanzweifel
Copy link
Owner

Thanks for all your comments and notes!

Here are some of my thoughts around this:

When I read your changes correctly, this change will remove the double authors from the commit (related to "But it doesn't work without changing the committer email. But as we change committer, it makes sense to change the author too.")

We once had the option to set commit_author_email and commit_author_name. I've removed them in 2.1.0 to make the action simpler and easier to use as less configuration is required to get started.

You've mentioned that the change of updating the committer didn't trigger a deployment of GitHub pages. Is this still the case?


I'm open to change how the authentication works.
Which version do you prefer now?

Version A:

https://${process.env.GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git

Version B:

https://${GH_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${GITHUB_REPOSITORY}.git

v2 of the checkout action has been released recently. They mention, that they have changed how the auth token is stored.

Script authenticated git commands: Auth token persisted in the local git config

Maybe we can remove the authentication part of the action completley, if v2 of checkout works reliably.


To be honest, my main concern currently is that changes break the action for others. Developing and debugging Actions feels very frustrating right now.
As I'm also not the only one who had the idea of an Action which commits back to the repository, I wonder if it would make sense to find the "one true" Action for this "feature" 🤔

I also have to re-read the Actions docs. So much stuff seems to have changes since I last looked at it.

@yelizariev
Copy link
Contributor Author

@stefanzweifel I think to split the discussion into different issues.

The first one about authentication is here: #28

@yelizariev
Copy link
Contributor Author

yelizariev commented Jan 7, 2020

I did this PR without understanding why do we need separate Author and Committer names. I just released that it makes sense in pull_request context. Let's discuss it here: #29

@yelizariev
Copy link
Contributor Author

Close this as it's split into several issues: #28 #29 #31 #32

@yelizariev yelizariev closed this Jan 7, 2020
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.

2 participants