Software Engineering

The best way to use Git Commit in GitHub Actions

The best way to use Git Commit in GitHub Actions
Written by admin


In case you’ve tried to make use of git commit in GitHub Actions earlier than, you will have come throughout the next error messages:

Creator identification unknown
*** Please inform me who you might be.

Run
  git config --global person.e mail "[email protected]"
  git config --global person.title "Your Identify"

to set your account's default identification.
Omit --global to set the identification solely on this repository.

deadly: empty ident title
    (for <[email protected]>) not allowed
Creator identification unknown

This may simply be fastened by doing the next:

Working Git Commit instantly in GitHub Actions

title: Commit date to grasp
on: push
jobs:
  date:
    runs-on: ubuntu-latest
    steps:
      - title: checkout
        makes use of: actions/[email protected]
      - title: save present date
        run: date > date.log
      - title: setup git config
        run: |
          git config person.title "GitHub Actions Bot"
          git config person.e mail "<>"
      - title: commit
        run: |
          git add date.log
          git commit -m "new commit message"
          git push origin grasp

Discover the addition of the git config objects:

git config person.title "GitHub Actions Bot"
git config person.e mail "<>"

An instance the place python calls git commit internally

title: Cron
on:
  schedule:
    - cron: '* * * * *'
jobs:
  construct:
    runs-on: ubuntu-latest
    steps:
      - makes use of: actions/[email protected]
      - title: setup python
        makes use of: actions/[email protected]
        with:
          python-version: 3.8
      - title: Run a one-line script
        run: |
          git config person.title "GitHub Actions Bot"
          git config person.e mail "<>"
          python run.py

About the author

admin

Leave a Comment