Skip to content

Commit 5d6139a

Browse files
committed
fix(git): unexpected git push error: fatal: could not read Username for 'https://github.com': No such device or address
@see: actions/checkout#664
1 parent aa302e8 commit 5d6139a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,18 @@ jobs:
7171
registry-url: https://registry.npmjs.org/
7272
cache: npm
7373

74-
- name: Setup git user
74+
# https://github.com/actions/checkout/issues/664
75+
- name: Setup git
7576
shell: bash
7677
run: |
7778
git config user.name ${{ secrets.GH_USER_NAME || github.actor }}
78-
if [ -z "${{ secrets.GH_USER_EMAIL }}" ]; then
79-
git config user.email ${{ github.actor }}@users.noreply.github.com
80-
else
79+
if [ "${{ secrets.GH_USER_EMAIL }}" ]; then
8180
git config user.email ${{ secrets.GH_USER_EMAIL }}
81+
else
82+
git config user.email ${{ github.actor }}@users.noreply.github.com
83+
fi
84+
if [ "${{ secrets.GH_TOKEN }}" ]; then
85+
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
8286
fi
8387
8488
# https://github.com/actions/setup-node/issues/411

0 commit comments

Comments
 (0)