GitHub Actions Bot Username and Email Address

Learn the correct username and email address to use for GitHub Actions Bot commits.

When writing a GitHub workflow, you may want it to automatically commit changes.

To distinguish between commits made by humans and those made by bots, set the committer name and email address to the GitHub Actions Bot.

Here are the details:

Username: github-actions[bot]
Email: 41898282+github-actions[bot]@users.noreply.github.com

You can configure these details for git with:

git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

Here is an example workflow step that commits and pushes changes if any files have been modified:

jobs:
  some-job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # other steps here
      - name: Commit and push changes
        id: commit
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
          if [[ -n "$(git status --porcelain)" ]]; then
            git add -A
            git commit -m "docs: update data"
            git push
          else
            echo "No changes to commit."
          fi

I hope this simple trick is useful for your DevOps tasks!

Thanks for reading and see you next time!