cpina/github-action-push-to-another-repository

Possible Bug

Laky-64 opened this issue · 10 comments

My repo is public but gives to me this error:

/usr/bin/docker run --name d5371714bb4b94[16](https://github.com/Squirrel-Network/GoBotApiGenerator/runs/6626431174?check_suite_focus=true#step:9:17)08106041dc82200fd_8ab128 --label 08450d --workdir /github/workspace --rm -e VERSION -e API_TOKEN_GITHUB -e INPUT_COMMIT-MESSAGE -e INPUT_SOURCE-DIRECTORY -e INPUT_DESTINATION-GITHUB-USERNAME -e INPUT_USER-NAME -e INPUT_DESTINATION-REPOSITORY-NAME -e INPUT_USER-EMAIL -e INPUT_TARGET-BRANCH -e INPUT_SOURCE-BEFORE-DIRECTORY -e INPUT_GITHUB-SERVER -e INPUT_DESTINATION-REPOSITORY-USERNAME -e INPUT_TARGET-DIRECTORY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/GoBotApiGenerator/GoBotApiGenerator":"/github/workspace" 08450d:537[17](https://github.com/Squirrel-Network/GoBotApiGenerator/runs/6626431174?check_suite_focus=true#step:9:18)14bb4b941608106041dc82[20](https://github.com/Squirrel-Network/GoBotApiGenerator/runs/6626431174?check_suite_focus=true#step:9:21)0fd  "" "./gobotapi" "Squirrel-Network" "gobotapi" "github.com" "<>" "Laky-64" "" "master" "Update to v 1.0.1" ""
[+] Action start
[+] Git version
git version 2.36.1
[+] Cloning destination git repository gobotapi
Cloning into '/tmp/tmp.bMBmfD'...
fatal: unable to access 'https://github.com/Squirrel-Network/gobotapi.git/': URL using bad/illegal format or missing URL
Error: Could not clone the destination repository. Command:
Error: git clone --single-branch --branch master ***github.com/Squirrel-Network/gobotapi.git /tmp/tmp.bMBmfD
Error: (Note that USER_NAME and API_TOKEN is redacted by GitHub)
Error: Please verify that the target repository exist AND that it contains the destination branch name, and is accesible by the API_TOKEN_GITHUB

My yaml:

- name: Update Compiled GoBotAPI
    uses: cpina/github-action-push-to-another-repository@main
      env:
          API_TOKEN_GITHUB: "${{ secrets.API_TOKEN_GITHUB }}"
        with:
          commit-message: "Update to v 1.1.2"
          source-directory: './gobotapi'
          destination-github-username: 'Squirrel-Network'
          user-name: 'Laky-64'
          destination-repository-name: 'gobotapi'
          user-email: <>
          target-branch: master
cpina commented

hi @Laky-64 : this is strange, I don't see how the URL could be https://github.com/Squirrel-Network/gobotapi.git/ (see the slash at the end that you had).

https://github.com/Squirrel-Network/GoBotApiGenerator does not seem to exist now: is it right?

Could you try again? In case that there was a GitHub redirect by mistake and caused this problem? (hours ago GitHub had some problems).

Could you try using instead of cpina/github-action-push-to-another-repository@main use cpina/github-action-push-to-another-repository@v1.4.2 ? This morning I made a small change in main and I'd like to confirm that this is not the problem. If it's a problem in main I still want to fix but I'll look again at the change that I made earlier.

I'll have another look in a few hours, I'll not be able to look soon probably.

Is private, lemme make public, i will try also 1.4.2

@cpina Are you there?

cpina commented

This might seem strange but the error does not come from git but it seems to come from curl (for example, just a random webpage googling the error because I couldn't find it in git's source code that I was checking for this): https://support.zendesk.com/hc/en-us/articles/4408819734426-API-error-curl-3-URL-using-bad-illegal-format-or-missing-URL

Do you know if the $API_TOKEN_GITHUB has some non-ascii character?

An idea would be to re-create it and hope for the best.

I will look into this in more detail - I haven't been able to reproduce the exact problem yet. I will try to have a better look at least to reproduce the problem tonight but I can't promise, need to do some other things first. Let me know if you can fix it re-creating the token.

cpina commented

For example, if $API_TOKEN_GITHUB had the character # it would cause your error message:

carles@pinux:/tmp/t$ git clone --single-branch --branch master https://cpina:not#my#password@github.com/Squirrel-Network/gobotapi.git/Cloning into 'gobotapi'...
fatal: unable to access 'https://github.com/Squirrel-Network/gobotapi.git/': URL using bad/illegal format or missing URL
carles@pinux:/tmp/t$ 

Hopefully this can help you!

Lemme check it

Yep, fixed, Thanks! ❤️

cpina commented

Yep, fixed, Thanks! heart

Happy!

Out of curiosity: was it a # character?

Was a space on the password