github-actions icon indicating copy to clipboard operation
github-actions copied to clipboard

could not read Username for 'https://github.com' whn using auto-commit action

Open karolis-arbaciauskas opened this issue 6 years ago • 4 comments

Hi. I'm facing error: fatal: could not read Username for 'https://github.com': No such device or address

Here is my config:

name: .NET Core CI

on: [push]

jobs:
  build:
    name: Generate epg
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Filter release branch
      uses: actions/bin/filter@master
      with:
        args: branch release
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.2.108
    - name: Build with dotnet
      run: dotnet build --configuration Release
    - name: Run with dotnet
      run: dotnet run
    - name: Auto-commit
      uses: docker://cdssnc/auto-commit-github-action
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_EPG_BOT_TOKEN }}
      with:
        args: This is an auto-commit

karolis-arbaciauskas avatar Aug 27 '19 17:08 karolis-arbaciauskas

Hi Acidfabric,

Sorry I only saw the issue today - I turned off my email notification on github :grimacing:.

I just merged https://github.com/cds-snc/github-actions/pull/25, maybe that will fix it.

Best Max

maxneuvians avatar Sep 18 '19 14:09 maxneuvians

Hi, I tried to use the action and it didn't worked. I get the same error message as @Acidfabric and my workflow configuration is also similar.

image

justalemon avatar Sep 23 '19 16:09 justalemon

Did you find a solution for this?

DanielFatkic avatar Oct 06 '19 20:10 DanielFatkic

TL;DR use actions/checkout@v2

Using version 2 of the checkout action solves this issue. While I haven't reviewed the actual code, I would be pretty certain that the following passage from the release notes (https://github.com/actions/checkout/releases) is the important bit:

Script authenticated git commands Persists the input token in the local git config

Updated After using it more in my project I've noticed that by default with the v2 checkout it will work just fine for push triggered jobs. If your job is defined on a pull_request trigger, you will need to add a parameter to the checkout action. Otherwise, you'll encounter the following error

error: unable to push to unqualified destination: HEAD

You will need to instruct the checkout action to checkout the branch referenced by the pull request, not the pull request itself (which it will do by default). Using the github.base_ref value:

      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

mhitza avatar Jan 01 '20 18:01 mhitza