Skip to content

Commit

Permalink
fix(git): unexpected git push error: fatal: could not read Username f…
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Jun 17, 2024
1 parent aa302e8 commit 5d6139a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ jobs:
registry-url: https://registry.npmjs.org/
cache: npm

- name: Setup git user
# https://github.com/actions/checkout/issues/664
- name: Setup git
shell: bash
run: |
git config user.name ${{ secrets.GH_USER_NAME || github.actor }}
if [ -z "${{ secrets.GH_USER_EMAIL }}" ]; then
git config user.email ${{ github.actor }}@users.noreply.github.com
else
if [ "${{ secrets.GH_USER_EMAIL }}" ]; then
git config user.email ${{ secrets.GH_USER_EMAIL }}
else
git config user.email ${{ github.actor }}@users.noreply.github.com
fi
if [ "${{ secrets.GH_TOKEN }}" ]; then
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
fi
# https://github.com/actions/setup-node/issues/411
Expand Down

0 comments on commit 5d6139a

Please sign in to comment.