Thursday, September 21, 2023
HomeSoftware EngineeringTips on how to use Git Commit in GitHub Actions

Tips on how to use Git Commit in GitHub Actions


For those who’ve tried to make use of git commit in GitHub Actions earlier than, you’ll have come throughout the next error messages:

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

Run
  git config --global person.e-mail "[email protected]"
  git config --global person.identify "Your Title"

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

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

This could simply be mounted by doing the next:

Operating Git Commit straight in GitHub Actions

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

Discover the addition of the git config gadgets:

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

An instance the place python calls git commit internally

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments