fregante / setup-git-token

GitHub Action that sets the GITHUB_TOKEN as credentials for git (enables `git push`)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ Deprecated

Starting with the v2 of actions/checkout, the token will be automatically set however you'll still have to manually set the commit author and email. It's best you use the new fregante/setup-git-user action instead:

Old version: actions/checkout@v1 + setup-git-token

    - uses: actions/checkout@v1
    - uses: fregante/setup-git-token@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

New version: actions/checkout@v2 + setup-git-user

    - uses: actions/checkout@v2
    - uses: fregante/setup-git-user@v1

Verbose action-less version

You don't really need an action anymore, but it's slightly more verbose:

    - uses: actions/checkout@v2
    - run: git config user.name "GitHub Actions"
    - run: git config user.email "actions@users.noreply.github.com"

setup-git-token

This action sets the GITHUB_TOKEN as credentials for git, allowing git push in successive steps. Additionally, the committer's email and name are also set.

Usage

See action.yml

Basic:

    steps:
    - uses: actions/checkout@master
    - uses: fregante/setup-git-token@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
    - run: git branch new-branch
    - run: git push origin new-branch

By default, new commits and tags will be assigned to the @actions user. If you wish to customize the committer, specify that using with.email and with.name:

    - uses: fregante/setup-git-token@v1
      with:
        name: The Bot
        email: bot@example.com

About

GitHub Action that sets the GITHUB_TOKEN as credentials for git (enables `git push`)

License:MIT License


Languages

Language:JavaScript 100.0%