GitHub Action
Setup Git environment
πΆ Install and configure Git for GitHub Actions
- run: git commit --message 'Automated changes'
# β Please tell me who you are.
# Run
# git config --global user.email "[email protected]"
# git config --global user.name "Your Name" |
- uses: actions4git/setup-git@v1
- run: git commit --message 'Automated changes'
# β
Committed 3 files |
π Lets you add additional safe directories
π Configures Git to use github.token
when pushing/pulling from github.server_url
π€ Sets up @github-actions[bot] as the default Git author
π Here's what you want:
on: push
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: actions4git/setup-git@v1
- run: git clone "https://github.com/$GITHUB_REPOSITORY.git" . # β
- run: npx --yes prettier --write .
- run: git add --all
- run: git commit --message 'Prettier' # β
- run: git push # β
git-version
is not yet implemented. Contributions
are welcome! β€οΈ
-
github-token
: GitHub token to use for authentication when pulling and pushing to the GitHub instance defined bygithub-server-url
. By default this is unset. You can set this togithub.token
or a personal access token if you want to configure GitHub authentication globally. -
github-server-url
: Server URL likehttps://github.example.org
to use as the scope for thegithub-token
. By default this usesgithub.server_url
which is usuallyhttps://github.com
. You shouldn't need to change this. -
user
: AName Here <[email protected]>
AiO user name & email string. This is a shortcut alternative to the independantuser-name
anduser-email
options that are also available. This defaults to @github-actions[bot]. You can set this to the special valuegithub-actions
to use the @github-actions[bot] user as the author, or the specialme
value to use the currentgithub.actor
user as the author. -
user-name
: The name of the user. Should be left unspecified ifuser
is specified. -
user-email
: The email of the user. Should be left unspecified ifuser
is specified. -
safe-directory
: A multiline list of globs to add to the Gitsafe-directory
list. Defaults to the current directory.
.
TODO!
How do I test my changes?
Open a Draft Pull Request and some magic GitHub Actions will run to test the action.