https://github.com/frequenz-floss/gh-action-setup-git
Configures the Git user, e-mail and crendentials
https://github.com/frequenz-floss/gh-action-setup-git
Last synced: about 1 year ago
JSON representation
Configures the Git user, e-mail and crendentials
- Host: GitHub
- URL: https://github.com/frequenz-floss/gh-action-setup-git
- Owner: frequenz-floss
- License: mit
- Created: 2024-02-21T11:37:19.000Z (over 2 years ago)
- Default Branch: v1.x.x
- Last Pushed: 2024-07-12T10:57:35.000Z (almost 2 years ago)
- Last Synced: 2025-01-28T03:17:19.581Z (over 1 year ago)
- Size: 30.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Git Setup Action
This action sets up Git for use in actions by configuring the user name and
email, and credentials.
Here is an example demonstrating how to use it in a workflow:
```yaml
jobs:
upload:
runs-on: ubuntu-20.04
steps:
- name: Fetch sources
uses: actions/checkout@v4
- name: Setup Git
# Replace the version with the latest version
uses: frequenz-floss/gh-action-setup-git@v1.0.0
```
This will configure the user name and email to impersonate the GitHub Actions
bot when new commits are created. No credentials are configured by default.
## Inputs
* `username`: The username to use for authentication.
* `password`: The password to use for authentication.
* `name`: The name to use for the Git user. Defaults to "GitHub Actions".
* `email`: The email to use for the Git user. Defaults to the GitHub Actions
bot email.
If any of `username` and `password` are provided, then Git will be configured
to use them for authentication. Otherwise, no credentials will be configured.
## Full example
```yaml
jobs:
upload:
runs-on: ubuntu-20.04
steps:
- name: Fetch sources
uses: actions/checkout@v4
- name: Setup Git
# Replace the version with the latest version
uses: frequenz-floss/gh-action-setup-git@v1.0.0
with:
username: ${{ secrets.GIT_USER }}
password: ${{ secrets.GIT_PASS }}
name: "John Doe"
email: "john.doe@example.com"
```
## Changelog
Please see the
[releases](https://github.com/frequenz-floss/gh-action-setup-git/releases/)
page.