Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

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

Open
karolis-arbaciauskas opened this issue Aug 27, 2019 · 4 comments

Comments

@karolis-arbaciauskas
Copy link

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 karolis-arbaciauskas changed the title could not read username could not read Username for 'https://github.com' Aug 27, 2019
@karolis-arbaciauskas karolis-arbaciauskas changed the title could not read Username for 'https://github.com' could not read Username for 'https://github.com' whn using auto-commit action Aug 27, 2019
@maxneuvians
Copy link
Contributor

Hi Acidfabric,

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

I just merged #25, maybe that will fix it.

Best
Max

@justalemon
Copy link

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

@DanielFatkic
Copy link

Did you find a solution for this?

@mhitza
Copy link

mhitza commented Jan 1, 2020

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 }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants