Fork-Sync-With-Upstream-action icon indicating copy to clipboard operation
Fork-Sync-With-Upstream-action copied to clipboard

could not read Username for 'https://github.com/': No such device or address error

Open drhcelik opened this issue 2 years ago • 5 comments

Hello. I created one Github Actions file to fetch upstream changes. The script that I used it below. When I run in test mode, it works quite well and doesn't throw any error. When I change test_mode to false, it gives me this error:

The error that I get:

fatal: could not read Username for 'https://github.com/': No such device or address
ERROR:  exit 128
Could not push changes to target repo.
Try running in test mode to verify your action input. If that does not help, please open an issue.
Resetting git config to previous settings.

May you help me to spot and fix my problem?

Thanks a lot.

Here my Github Actions file:

name: 'Upstream Sync'

on:
  schedule:
    - cron:  '0 4 * * 1,2,3,4,5,6'
    # scheduled at 07:00 every Monday and Thursday

  workflow_dispatch:  # click the button on Github repo!

jobs:
  sync_latest_from_upstream:
    runs-on: ubuntu-latest
    name: Sync latest commits from upstream repo

    steps:
    # REQUIRED step
    # Step 1: run a standard checkout action, provided by github
    - name: Checkout target repo
      uses: actions/checkout@v2
      with:
        # optional: set the branch to checkout,
        # sync action checks out your 'target_sync_branch' anyway
        ref:  master
        # REQUIRED if your upstream repo is private (see wiki)
        persist-credentials: false

    # REQUIRED step
    # Step 2: run the sync action
    - name: Sync upstream changes
      id: sync
      uses: aormsby/[email protected]
      with:
        target_sync_branch: master
        # REQUIRED 'target_repo_token' exactly like this!
        target_repo_token: ${{ secrets.GITHUB_TOKEN }}
        upstream_sync_branch: master
        upstream_sync_repo: OpenFOAM/OpenFOAM-dev

        # Set test_mode true to run tests instead of the true action!!
        test_mode: true
      
    # Step 3: Display a sample message based on the sync output var 'has_new_commits'
    - name: New commits found
      if: steps.sync.outputs.has_new_commits == 'true'
      run: echo "New commits were found to sync."
    
    - name: No new commits
      if: steps.sync.outputs.has_new_commits == 'false'
      run: echo "There were no new commits."
      
    - name: Show value of 'has_new_commits'
      run: echo ${{ steps.sync.outputs.has_new_commits }}

drhcelik avatar Jul 04 '22 13:07 drhcelik

Have you tried reading through the closed issues? I'm pretty sure this has come up a few times, but the fixes may have been different.

aormsby avatar Jul 05 '22 01:07 aormsby

Yes, I checked closed issues as well, it seems like using v3 might fix the problem. I haven't tried it actually, but I may give it a try

drhcelik avatar Jul 06 '22 06:07 drhcelik

Same problem, and the method in issue #45 don't work. Using v3.3.

My config file:

name: 'Upstream Sync'

on:
  schedule:
    - cron:  '*/60 */8 * * *'

  workflow_dispatch:  # click the button on Github repo!

jobs:
  sync_latest_from_upstream:
    runs-on: ubuntu-latest
    name: Sync latest commits from upstream repo

    steps:
    # REQUIRED step
    # Step 1: run a standard checkout action, provided by github
    - name: Checkout target repo
      uses: actions/checkout@v2
      with:
        # optional: set the branch to checkout,
        # sync action checks out your 'target_sync_branch' anyway
        ref: patch-1
        # REQUIRED if your upstream repo is private (see wiki)
        persist-credentials: false
        fetch-depth: 0

    # REQUIRED step
    # Step 2: run the sync action
    - name: Sync upstream changes
      id: sync
      uses: aormsby/[email protected]
      with:
        target_sync_branch: patch-1
        # REQUIRED 'target_repo_token' exactly like this!
        target_repo_token: ${{ secrets.GITHUB_TOKEN }}
        upstream_sync_branch: main
        upstream_sync_repo: ccfddl/ccf-deadlines
        upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }}

        # Set test_mode true to run tests instead of the true action!!
        test_mode: false
        upstream_pull_args: '--allow-unrelated-histories'
      
    # Step 3: Display a sample message based on the sync output var 'has_new_commits'
    - name: New commits found
      if: steps.sync.outputs.has_new_commits == 'true'
      run: echo "New commits were found to sync."
    
    - name: No new commits
      if: steps.sync.outputs.has_new_commits == 'false'
      run: echo "There were no new commits."
      
    - name: Show value of 'has_new_commits'
      run: echo ${{ steps.sync.outputs.has_new_commits }}

Sumsky21 avatar Jul 12 '22 13:07 Sumsky21

Having the same issue here. Looked through the old issues and tried everything mentioned there as well.

adamwilborn avatar Jul 15 '22 23:07 adamwilborn

Throwing my 2 cents in here too. Same error as drhcelik. Tried fixes in #45 but no luck.

Pushing synced data to target branch.
fatal: could not read Username for 'https://github.com/': No such device or address
ERROR:  exit 128
Could not push changes to target repo.
Try running in test mode to verify your action input. If that does not help, please open an issue.

the-sphynx avatar Sep 20 '22 20:09 the-sphynx

Me too

GuyKh avatar Oct 08 '22 14:10 GuyKh

Please look on this PR.

PeterVoronov avatar Oct 19 '22 06:10 PeterVoronov

Temporary you can apply a fix via:

uses: PeterVoronov/Fork-Sync-With-Upstream-action@remote_set-url_fix

PeterVoronov avatar Oct 19 '22 06:10 PeterVoronov

Thanks for fixing this. I merged into v3.4. It's currently pre-release, and if someone here can verify the fix I'll make it a full release.

https://github.com/marketplace/actions/upstream-sync?version=v3.4

aormsby avatar Oct 30 '22 23:10 aormsby

Thanks for fixing this. I merged into v3.4. It's currently pre-release, and if someone here can verify the fix I'll make it a full release.

https://github.com/marketplace/actions/upstream-sync?version=v3.4

You are always welcome!

And thanks for this package!

PeterVoronov avatar Oct 31 '22 16:10 PeterVoronov

If it helps, I just used the 3.4 version and had the action run successfully. Thank you all for patching this up.

sprak3000 avatar Nov 10 '22 15:11 sprak3000

Thanks, will release fully

aormsby avatar Nov 19 '22 23:11 aormsby