Skip to content

Improve example workflow#35

Closed
kevinvanrijn wants to merge 0 commit into
ad-m:masterfrom
kevinvanrijn:example-workflow
Closed

Improve example workflow#35
kevinvanrijn wants to merge 0 commit into
ad-m:masterfrom
kevinvanrijn:example-workflow

Conversation

@kevinvanrijn

@kevinvanrijn kevinvanrijn commented Nov 26, 2019

Copy link
Copy Markdown

This makes 3 changes to the example workflow:

  1. Create the commit with github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> as the author and GitHub <noreply@github.com> as the committer. (Explanation in the comment below.)
    Example:
  2. Do not configure a Git user. (Avoids another step accidentally creating/modifying commits with inaccurate author/committer information.)
  3. Do nothing when there are no changes to be committed. (Instead of throwing an error and failing the workflow.)

Opinions?

@kevinvanrijn

kevinvanrijn commented Nov 27, 2019

Copy link
Copy Markdown
Author

This isn't completely correct yet. Looking at how Dependabot does it, commits are created with the author dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> and the committer GitHub <noreply@github.com>

This is how pull requests and commits made through the file uploader/editor on GitHub.com are created as well. The author being the noreply email from the current user and the committer being GitHub <noreply@github.com>.

That email Dependabot uses is an actual account: https://api.github.com/users/dependabot-preview%5Bbot%5D

It turns out that GitHub Actions has an account tied to it as well: https://api.github.com/users/github-actions%5Bbot%5D (You'll have seen this account show up if you use ${{ secrets.GITHUB_TOKEN }} to create a pull request for example.)

So ideally, a commit made by a workflow should be created with github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> as the author and GitHub <noreply@github.com> as the committer.

@kevinvanrijn kevinvanrijn changed the title Improve example workflow [WIP] Improve example workflow Nov 27, 2019
@kevinvanrijn kevinvanrijn changed the title [WIP] Improve example workflow [RFC] Improve example workflow Nov 27, 2019
@tenhobi

tenhobi commented Dec 3, 2019

Copy link
Copy Markdown
Contributor

What that 41898282 stand for?

@kevinvanrijn

kevinvanrijn commented Dec 3, 2019

Copy link
Copy Markdown
Author

@tenhobi It's the user id of the Github Actions account/bot.

EDIT: I should probably also explain that any commit created on GitHub.com (or by a GitHub owned bot like Dependabot) always use the email id+login@users.noreply.github.com as the author.

You can find your unique email under "Keep my email addresses private" in https://github.com/settings/emails

Mine is 6368561+kevinvanrijn@users.noreply.github.com for example. (This is all public information through the API.)

@koppor

koppor commented Jan 2, 2020

Copy link
Copy Markdown
Contributor

@kevinvanrijn Yes, it would be nice if you added a short note on that. Then, this is good to go!

@kevinvanrijn kevinvanrijn changed the title [RFC] Improve example workflow Improve example workflow Jan 2, 2020
@kevinvanrijn

kevinvanrijn commented Jan 2, 2020

Copy link
Copy Markdown
Author

@koppor Done.

A quick bit of news from another action. create-pull-request is also using the GitHub Actions bot user as its default account since v2.

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