Skip to content

GitHub Action to set up the "user.name" and "user.email" git config options.

License

Notifications You must be signed in to change notification settings

actions-rindeal/git-config-user-old

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set Up Git User

Sets Git config options user.name and user.email to enable commit operations.


Test Git Config User Action

Quick Start

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: rindeal/action-git-config-user@v1
    - run: |
      touch foo
      git commit -am "Commits work and are attributed to Github Actions bot"

Inputs

  • name

    • The user.name value for git config.
  • email

    • The user.email value for git config.
  • scope

    • The scope of git config. Will be converted into a <file-option> as described in the GIT-CONFIG(1) manpage.
    • Default is local.
    • Options are:
      • local
      • global
      • worktree
      • file
  • scope-file-path

    • Path to a file for --file scope of git config.
    • Eg. ~/.my-custom-gitconfig.
  • working-directory

    • Working Directory. Default is a standard $GITHUB_WORKSPACE.

Outputs

  • name

    • The user.name applied to git config.
  • email

    • The user.email applied to git config.
  • scope

    • The scope applied to git config.
  • scope-file-path

    • The scope-file-path applied to git config.

Detailed Example

uses: rindeal/action-git-config-user@v1
with:
  name: 'Your Name'
  email: 'your-email@example.com'
  scope: 'local'
  working-directory: './path/to/your/project'

In this example, the user.name and user.email are set for the local scope of the Git configuration in the specified working directory.

Default name and email

The default name and email are set to:

GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>

  • The name is set to "GitHub Actions" because this action is designed to be run in the context of GitHub Actions. It's a way to indicate that the commits are made by an automated process, not a human.

  • The email is set to "41898282+github-actions[bot]@users.noreply.github.com", because it's the email address associated with the GitHub Actions bot, which will link the bot's official page.

These defaults ensure that the commits made by this action are correctly attributed to GitHub Actions in the commit history. However, you can override these defaults with your own name and email if you want the commits to be attributed to a specific user.

Author and License

Authored by Jan Chren (rindeal). Licensed under GPL-3.0-only. This license permits copying, modification, and distribution of the software. The same license must be applied to all software versions. Fork and modify as needed, but respect the license.