Skip to content

Set git user and email #13

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

Open
wesleytodd opened this issue Aug 16, 2019 · 23 comments · May be fixed by #584 or #2012
Open

Set git user and email #13

wesleytodd opened this issue Aug 16, 2019 · 23 comments · May be fixed by #584 or #2012
Labels
enhancement New feature or request

Comments

@wesleytodd
Copy link

wesleytodd commented Aug 16, 2019

It would be great if this action would also set the email and name. In order to do other git operations it is required. I am adding this to my actions to get around it:

steps:
  - uses: actions/checkout@v1
  - name: Setup git user
    run: |
        git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
        git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"

Unfortunately I don't have access to the user email. It seems like these can come from the account in a more clean way here, but I guess I could also create my own action. Since this is so new I am not sure what the best way forward is so thought I would post here.

@TingluoHuang
Copy link
Member

@chrispat for feedback.

@eine
Copy link

eine commented Oct 25, 2019

This would be useful for users willing to update gh-pages hosted on separate repos using a deployment key (e.g. https://github.com/1138-4EB/vunit/blob/migrate-to-gha/.github/workflows/push.yml#L63-L74). This is specially so, because GITHUB_TOKEN's scope is limited and personal access tokens are not scoped to a single target repo.

@wesleytodd
Copy link
Author

This would be useful for users willing to update gh-pages

This was actually my first use case for this!

https://github.com/pkgjs/gh-pages/blob/master/entrypoint.sh#L4-L5

@fregante
Copy link

fregante commented Oct 31, 2019

I recently wrote an action that sets up the user and email the @action user, so you can also push back to the repo, as long as you use the v2 of actions/checkout

https://github.com/fregante/setup-git-user

  steps:
    - uses: actions/checkout@v2
    - uses: fregante/setup-git-user@v1
Old action I recently wrote an action that sets up the user, email and token in one go, so you can also push back to the repo.

https://github.com/fregante/setup-git-token

    - uses: fregante/setup-git-token@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        name: The Bot
        email: bot@example.com

@eine
Copy link

eine commented Dec 16, 2019

@ericsciple, should this issue be closed now that #107 is merged? It seems to be included in v2: https://github.com/actions/checkout/commits/v2

@wesleytodd
Copy link
Author

So that PR is a bit hard to grok on my phone (even with the improvements in the GitHub app), but it is unclear if that sets the name and email. This issue is specifically about that need. Does that PR solve this use case indirectly?

@eine
Copy link

eine commented Dec 18, 2019

@wesleytodd, see:

checkout/action.yml

Lines 12 to 17 in 3537747

token:
description: >
Auth token used to fetch the repository. The token is stored in the local
git config, which enables your scripts to run authenticated git commands.
The post-job step removes the token from the git config.
default: ${{ github.token }}

It seems to me that this issue was/is about "do other (authenticated) git operations"; precisely update gh-pages (which was/is your "first use case for this"). Explicitly setting the user and email would have been an approach. Using the token to do so is just another suitable solution.

Moreover, I think it would be desirable to support optionally using deployment keys instead of tokens (be it the default or a PAT). This is because default tokens do not allow to update other repos; while PATs provide too many permissions. Nonetheless, even if keys were supported, I believe that setting the user and email would still be a side effect.

Therefore, I think that this issue should be either closed or repurposed to account for the new feature in master.

@wesleytodd
Copy link
Author

Awesome, thanks for the more clear explanation! I have never used the method I see in that PR, so one last question I have:

Does using a token for git auth also stop git from complaining about no user or email when committing?

@eine
Copy link

eine commented Dec 19, 2019

Does using a token for git auth also stop git from complaining about no user or email when committing?

Although I'm not sure about that, I believe it should. The usefulness of the feature would be very limited otherwise.

Anyway, even if it works, there is currently a bug that prevents gh-pages from being updated when the token is used: actions/toolkit#247. Hence, you might want to keep using a deployment key.

@HDouss
Copy link

HDouss commented Jan 28, 2020

Awesome, thanks for the more clear explanation! I have never used the method I see in that PR, so one last question I have:

Does using a token for git auth also stop git from complaining about no user or email when committing?

No, that does not stop git from complaining. You still have to git config name and email. All what it does is that commits and pushes are well authenticated, but you should provide name and email before that. And yes, that limits the usefulness as @eine said.

@ericsciple
Copy link
Contributor

ericsciple commented Feb 13, 2020

+1 i didnt realize the built-in GITHUB_TOKEN has push permission... i'll open an adr shortly...

@ericsciple
Copy link
Contributor

ericsciple commented Feb 14, 2020

ADR: #158

@ericsciple
Copy link
Contributor

ericsciple commented Feb 15, 2020

Also note, in the interim it looks like GIT_AUTHOR_NAME etc can be specified

@JojOatXGME
Copy link

JojOatXGME commented Nov 10, 2020

I think this would be a nice feature. It would also lead to a more consistent appearance of commits created by GitHub Actions. I'm currently wondering which email address and username I should use for the time being.

  1. The README.md suggests github-actions <github-actions@github.com>. However, this email is not recognized by the platform. GitHub displays the author of the commit with the generic icon and without a link.
    grafik
  2. A thread in the GitHub Support Community suggests github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>. This seems to work nicely. The author of the commit has the same icon and name as GitHub Actions everywhere else. The link goes to https://github.com/features/actions as I would expect. I'm just wondering if there is any caveat since it is not promoted in the README.md.
    grafik
  3. Most repositories I found seem to use GitHub Action <action@github.com>. I don't know where this is comming from. GitHub seems to link it to some user but clicking on the user opens a 404-page. The icon and name doesn't match what is usually shown for GitHub Actions.
    grafik

If there is no caveat for the second option, I would suggest that the checkout action configures Git accordingly if none of both options is already set. (Alternatively, GitHub's runners could be updated to use this configuration.)

@ChrisCarini
Copy link

@JojOatXGME - I don't know exactly where the user from your #3 is really coming from either, but I do see the below two GitHub Actions having examples using this 'user':

Searching GH for this shows there are currently over 7k+ workflows using this action, so it's also possible that there is a lot of 'copy&paste' workflow creation going on (I've done this myself, several times..) -> https://github.com/search?q=git+config+local+user.email+action%40github.com&type=code

No matter, thank you very much for the breakdown - an internet search landed me on this issue and your comment was exactly what I was looking for! I think this issue conversation, along with the "GitHub Actions bot email address?" conversation in the community forum is enough information for folks to figure out how to get the information needed to have the commit author show nicely on the GitHub interface.

All that to say, I would also love to see this feature request implemented, as it would be nice for GitHub workflow authors.

ad-m pushed a commit to ad-m/github-push-action that referenced this issue Jan 2, 2021
See the differences between these two 'users' here: actions/checkout#13 (comment)

As well as some investigation here: https://github.community/t/github-actions-bot-email-address/17204

Also changing the `default` in the docs to reflect the actual default specified in the `actions.yml` file.
jbelien added a commit to EqualStreetNames/equalstreetnames that referenced this issue Jan 5, 2021
windmgc referenced this issue in windmgc/chnroute_auto Feb 20, 2021
@jasonkarns
Copy link

A quick hack that might be fragile, but also Just Might Work for most cases:

git commit -am message --author=.

per the docs
git-commit assumes the --author argument to be of the form: A U Thor <author@example.com>.

Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found.

So, in short: commit --author=. should copy the authorship from the previous commit since . as a regex will match all commits.

ccutrer added a commit to hap-java/HAP-Java that referenced this issue Oct 12, 2022
see  actions/checkout#13 (comment)

also update the actions to non-deprecated versions
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

While playing with the code, I found some problems in the recently merged version-bumping workflow:
- Most importantly, now that we are using `0.8.0-dev` in development, the workflow will try to bump it to `0.9.0` 😭 
- The crate filter is outdated now that we have more crates in `tools`.
- We are using `bevy@users.noreply.github.com`, but according to [Github help](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#about-commit-email-addresses), that email address means "old no-reply email format for the user `bevy`". It is currently not associated with any account, but I feel this is still not appropriate here.

## Solution

- Create a new workflow, `Post-release version bump`, that should be run after a release and bumps version from `0.X.0` to `0.X+1.0-dev`. Unfortunately, cargo-release doesn't have a builtin way to do this, so we need to parse and increment the version manually.
- Add the new crates in `tools` to exclusion list. Also removes the dependency version specifier from `bevy_ecs_compile_fail_tests`. It is not in the workspace so the dependency version will not get automatically updated by cargo-release.
- Change the author email to `41898282+github-actions[bot]@users.noreply.github.com`. According to the discussion [here](actions/checkout#13 (comment)) and [here](https://github.community/t/github-actions-bot-email-address/17204/6), this is the email address associated with the github-actions bot account.
- Also add the workflows to our release checklist.

See infmagic2047#5 and infmagic2047#6 for examples of release and post-release PRs.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

While playing with the code, I found some problems in the recently merged version-bumping workflow:
- Most importantly, now that we are using `0.8.0-dev` in development, the workflow will try to bump it to `0.9.0` 😭 
- The crate filter is outdated now that we have more crates in `tools`.
- We are using `bevy@users.noreply.github.com`, but according to [Github help](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#about-commit-email-addresses), that email address means "old no-reply email format for the user `bevy`". It is currently not associated with any account, but I feel this is still not appropriate here.

## Solution

- Create a new workflow, `Post-release version bump`, that should be run after a release and bumps version from `0.X.0` to `0.X+1.0-dev`. Unfortunately, cargo-release doesn't have a builtin way to do this, so we need to parse and increment the version manually.
- Add the new crates in `tools` to exclusion list. Also removes the dependency version specifier from `bevy_ecs_compile_fail_tests`. It is not in the workspace so the dependency version will not get automatically updated by cargo-release.
- Change the author email to `41898282+github-actions[bot]@users.noreply.github.com`. According to the discussion [here](actions/checkout#13 (comment)) and [here](https://github.community/t/github-actions-bot-email-address/17204/6), this is the email address associated with the github-actions bot account.
- Also add the workflows to our release checklist.

See infmagic2047#5 and infmagic2047#6 for examples of release and post-release PRs.
kachick added a commit to kachick/action-update-dprint-plugins that referenced this issue Jun 1, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 16, 2023
sagemathgh-36243: ⬆️ Bump actions/checkout from 3 to 4
    
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to
4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update default runtime to node20 by <a
href="https://github.com/takost"><code>@​takost</code></a> in <a href="h
ttps://redirect.github.com/actions/checkout/pull/1436">actions/checkout#
1436</a></li>
<li>Support fetching without the --progress option by <a
href="https://github.com/simonbaird"><code>@​simonbaird</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1067">actions/ch
eckout#1067</a></li>
<li>Release 4.0.0 by <a
href="https://github.com/takost"><code>@​takost</code></a> in <a href="h
ttps://redirect.github.com/actions/checkout/pull/1447">actions/checkout#
1447</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/takost"><code>@​takost</code></a> made
their first contribution in <a href="https://redirect.github.com/actions
/checkout/pull/1436">actions/checkout#1436</a></li>
<li><a
href="https://github.com/simonbaird"><code>@​simonbaird</code></a> made
their first contribution in <a href="https://redirect.github.com/actions
/checkout/pull/1067">actions/checkout#1067</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/
checkout/compare/v3...v4.0.0">https://github.com/actions/checkout/compar
e/v3...v4.0.0</a></p>
<h2>v3.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Mark test scripts with Bash'isms to be run via Bash by <a
href="https://github.com/dscho"><code>@​dscho</code></a> in <a href="htt
ps://redirect.github.com/actions/checkout/pull/1377">actions/checkout#13
77</a></li>
<li>Add option to fetch tags even if fetch-depth &gt; 0 by <a href="http
s://github.com/RobertWieczoreck"><code>@​RobertWieczoreck</code></a> in
<a href="https://redirect.github.com/actions/checkout/pull/579">actions/
checkout#579</a></li>
<li>Release 3.6.0 by <a
href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a>
in <a href="https://redirect.github.com/actions/checkout/pull/1437">acti
ons/checkout#1437</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/RobertWieczoreck"><code>@​RobertWieczore
ck</code></a> made their first contribution in <a href="https://redirect
.github.com/actions/checkout/pull/579">actions/checkout#579</a></li>
<li><a
href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a>
made their first contribution in <a href="https://redirect.github.com/ac
tions/checkout/pull/1437">actions/checkout#1437</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/
checkout/compare/v3.5.3...v3.6.0">https://github.com/actions/checkout/co
mpare/v3.5.3...v3.6.0</a></p>
<h2>v3.5.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix: Checkout Issue in self hosted runner due to faulty submodule
check-ins by <a
href="https://github.com/megamanics"><code>@​megamanics</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1196">actions/ch
eckout#1196</a></li>
<li>Fix typos found by codespell by <a href="https://github.com/DimitriP
apadopoulos"><code>@​DimitriPapadopoulos</code></a> in <a href="https://
redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a
></li>
<li>Add support for sparse checkouts by <a
href="https://github.com/dscho"><code>@​dscho</code></a> and <a
href="https://github.com/dfdez"><code>@​dfdez</code></a> in <a href="htt
ps://redirect.github.com/actions/checkout/pull/1369">actions/checkout#13
69</a></li>
<li>Release v3.5.3 by <a
href="https://github.com/TingluoHuang"><code>@​TingluoHuang</code></a>
in <a href="https://redirect.github.com/actions/checkout/pull/1376">acti
ons/checkout#1376</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/megamanics"><code>@​megamanics</code></a> made
their first contribution in <a href="https://redirect.github.com/actions
/checkout/pull/1196">actions/checkout#1196</a></li>
<li><a href="https://github.com/DimitriPapadopoulos"><code>@​DimitriPapa
dopoulos</code></a> made their first contribution in <a href="https://re
direct.github.com/actions/checkout/pull/1287">actions/checkout#1287</a><
/li>
<li><a href="https://github.com/dfdez"><code>@​dfdez</code></a> made
their first contribution in <a href="https://redirect.github.com/actions
/checkout/pull/1369">actions/checkout#1369</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/
checkout/compare/v3...v3.5.3">https://github.com/actions/checkout/compar
e/v3...v3.5.3</a></p>
<h2>v3.5.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix: Use correct API url / endpoint in GHES by <a
href="https://github.com/fhammerl"><code>@​fhammerl</code></a> in <a hre
f="https://redirect.github.com/actions/checkout/pull/1289">actions/check
out#1289</a> based on <a href="https://redirect.github.com/actions/check
out/issues/1286">sagemath#1286</a> by <a
href="https://github.com/1newsr"><code>@​1newsr</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/
checkout/compare/v3.5.1...v3.5.2">https://github.com/actions/checkout/co
mpare/v3.5.1...v3.5.2</a></p>
<h2>v3.5.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Improve checkout performance on Windows runners by upgrading
<code>@​actions/github</code> dependency by <a
href="https://github.com/BrettDong"><code>@​BrettDong</code></a> in <a h
ref="https://redirect.github.com/actions/checkout/pull/1246">actions/che
ckout#1246</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/BrettDong"><code>@​BrettDong</code></a>
made their first contribution in <a href="https://redirect.github.com/ac
tions/checkout/pull/1246">actions/checkout#1246</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/actions/checkout/blob/ma
in/CHANGELOG.md">actions/checkout's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>v4.0.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1067">Support
fetching without the --progress option</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1436">Update to
node20</a></li>
</ul>
<h2>v3.6.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1377">Fix: Mark
test scripts with Bash'isms to be run via Bash</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/579">Add
option to fetch tags even if fetch-depth &gt; 0</a></li>
</ul>
<h2>v3.5.3</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1196">Fix:
Checkout fail in self-hosted runners when faulty submodule are checked-
in</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1287">Fix
typos found by codespell</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1369">Add
support for sparse checkouts</a></li>
</ul>
<h2>v3.5.2</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1289">Fix
api endpoint for GHES</a></li>
</ul>
<h2>v3.5.1</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1246">Fix
slow checkout on Windows</a></li>
</ul>
<h2>v3.5.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1237">Add
new public key for known_hosts</a></li>
</ul>
<h2>v3.4.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1209">Upgrade
codeql actions to v2</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1210">Upgrade
dependencies</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1225">Upgrade
<code>@​actions/io</code></a></li>
</ul>
<h2>v3.3.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1045">Implement
branch list using callbacks from exec function</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1050">Add
in explicit reference to private checkout options</a></li>
<li>[Fix comment typos (that got added in <a href="https://redirect.gith
ub.com/actions/checkout/issues/770">sagemath#770</a>)](<a href="https://redirect
.github.com/actions/checkout/pull/1057">actions/checkout#1057</a>)</li>
</ul>
<h2>v3.2.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/942">Add
GitHub Action to perform release</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/967">Fix
status badge</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1002">Replace
datadog/squid with ubuntu/squid Docker image</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/964">Wrap
pipeline commands for submoduleForeach in quotes</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1029">Update
<code>@​actions/io</code> to 1.1.2</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1039">Upgrading
version to 3.2.0</a></li>
</ul>
<h2>v3.1.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/939">Use
<code>@​actions/core</code> <code>saveState</code> and
<code>getState</code></a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/922">Add
<code>github-server-url</code> input</a></li>
</ul>
<h2>v3.0.2</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/770">Add
input <code>set-safe-directory</code></a></li>
</ul>
<h2>v3.0.1</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="actions/checkout@3df4ab11eba7bda6
032a0b82a6bb43b11571feac"><code>3df4ab1</code></a> Release 4.0.0 (<a hre
f="https://redirect.github.com/actions/checkout/issues/1447">#1447</a>)<
/li>
<li><a href="actions/checkout@8b5e8b768746b503
94015010d25e690bfab9dfbc"><code>8b5e8b7</code></a> Support fetching
without the --progress option (<a href="https://redirect.github.com/acti
ons/checkout/issues/1067">sagemath#1067</a>)</li>
<li><a href="actions/checkout@97a652b80035363d
f47baee5031ec8670b8878ac"><code>97a652b</code></a> Update default
runtime to node20 (<a href="https://redirect.github.com/actions/checkout
sagemath/issues/1436">sagemath#1436</a>)</li>
<li>See full diff in <a
href="https://github.com/actions/checkout/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-
badges.githubapp.com/badges/compatibility_score?dependency-
name=actions/checkout&package-manager=github_actions&previous-
version=3&new-version=4)](https://docs.github.com/en/github/managing-
security-vulnerabilities/about-dependabot-security-updates#about-
compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
    
URL: sagemath#36243
Reported by: dependabot[bot]
Reviewer(s):
@wesleytodd
Copy link
Author

I hit this again today. Wondering if there is anyone who can take a look at this and at least provide an answer for if there is some new feature for this or if this should remain as an open request?

@SpecLad
Copy link

SpecLad commented Oct 12, 2023

The name/email should be determined by the access token used for the checkout. That way, it would be set appropriately whenever you're using the default token, a personal access token, or an app token.

cvn added a commit to cvn/tldr-python-dash-docset that referenced this issue Oct 31, 2023
jennybc added a commit to r-lib/usethis that referenced this issue Feb 13, 2024
Apparently lots of other people would also love this to be more automatic: actions/checkout#13
llrs added a commit to llrs/cranis that referenced this issue May 25, 2024
@janbrasna
Copy link

While I share the sentiment above regarding correctly setting the git credentials for either the PAT or maybe github.actor by default, I'm surprised there's nothing set by default, like the action bot above, to save setting that gazillion times a day from workflows…

BTW to update the list above:

  1. The [README.md] suggests github-actions <github-actions@github.com>. However, this email is not recognized by the platform. GitHub displays the author of the commit with the generic icon and without a link.
    grafik

This has been fixed since, as running this most simple config links the bot account as below correctly. So this is now my fav syntax, not having quote stuff and remembering ids etc., just works mid-2024.

The README now shows 2.# instead though:

  1. [A thread in the GitHub Support Community] suggests github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>. This seems to work nicely. The author of the commit has the same icon and name as GitHub Actions everywhere else. The link goes to https://github.com/features/actions as I would expect. I'm just wondering if there is any caveat since it is not promoted in the README.md.
    grafik

This is now in the README as is the most complete syntax. But a little superfluous, with risks like badly escaping the \["]" characters etc. so I prefer 1.# instead.

The last one is probably not for public use like this…

  1. Most repositories I found seem to use GitHub Action <action@github.com>. I don't know where this is comming from. GitHub seems to link it to some user but clicking on the user opens a 404-page. The icon and name doesn't match what is usually shown for GitHub Actions.
    grafik

Oh that feels like some internal user used for owning the actions, or maybe running them in the past. So basically that is a valid user and is owned by GH, it's some sort of a technical account and it's better use the well known bot accounts above.

TL;DR i'm running:

git config user.name github-actions
git config user.email github-actions@github.com

to avoid any quotes and escapes and whatnot, and it is attributed correctly:

Screen Shot 2024-07-03 at 21 05 42

CamJN added a commit to getargv/getargv.js that referenced this issue Aug 2, 2024
@qoomon
Copy link

qoomon commented Aug 2, 2024

I wrote a simple action to tackle this problem once and for all https://github.com/qoomon/actions--setup-git

@chouetz
Copy link

chouetz commented Dec 20, 2024

Hi 👋🏽
In case anyone is still following this issue I've done (yet another) suggestion PR #2012 (as the other ones are old and not updated after comments) which is waiting for owner's review.
I think it makes sense to have this feature included in action/checkout rather than using another action to setup the git config.
Thanks in advance

mihaelmiklec added a commit to blockhousetech/eudi-rust-core that referenced this issue Apr 14, 2025
While running on github-hosted runners, it's necessary to manually set
up git user/email (actions/checkout#13) for
the time being.

The user/email used was taken from a suggestion in `actions/checkout`
README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
mihaelmiklec added a commit to blockhousetech/eudi-rust-core that referenced this issue Apr 16, 2025
While running on github-hosted runners, it's necessary to manually set
up git user/email (actions/checkout#13) for
the time being.

The user/email used was taken from a suggestion in `actions/checkout`
README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
mihaelmiklec added a commit to blockhousetech/eudi-rust-core that referenced this issue Apr 17, 2025
While running on github-hosted runners, it's necessary to manually set
up git user/email (actions/checkout#13) for
the time being.

The user/email used was taken from a suggestion in `actions/checkout`
README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
mihaelmiklec added a commit to blockhousetech/eudi-rust-core that referenced this issue Apr 17, 2025
While running on github-hosted runners, it's necessary to manually set
up git user/email (actions/checkout#13) for
the time being.

The user/email used was taken from a suggestion in `actions/checkout`
README:
https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
16 participants