dmnemec / copy_file_to_another_repo_action

This GitHub Action copies a file from the current repository to a location in another repository
Apache License 2.0
183 stars 206 forks source link

URL using bad/illegal format or missing URL #44

Closed SpyrexDE closed 2 years ago

SpyrexDE commented 3 years ago

I try to use this action for my GitHub organization. So for destination_repo, I entered 'ORGANIZATION_NAME/REPO_NAME'. However, I then get the following error: fatal: unable to access 'https:///ORGANIZATION_NAME/REPO_NAME.git/': URL using bad/illegal format or missing URL

Eseoghene commented 3 years ago

I am experiencing the same issue as well

TomoeMami commented 3 years ago

same problem here


Edit: According to the pull request #28 , there should be a default value set as github.com for the variable github_server. But it didn't, so manually add this line to with: could solve the problem:

    with:
        github_server: 'github.com'

Works for me.


Edit2: After checking the source code, I realized that my assumption is wrong. Just because the variable git_server is falsely named, it should be called as github_server.

benjaminParisel commented 3 years ago

same problem here, but solution purpose by @TomoeMami work well for me. Thank !

stetttho commented 3 years ago

@dmnemec thanks for this helpful repo, but this is the second breaking update within a couple of weeks. is it possible for you to check the PRs first before accepting?

PS: the fix suggested by @TomoeMami (you meant git_server instead of github_server, right?) is not working for me.. switching back to an older version for now as suggested here _Originally posted by @RossMurr4y in https://github.com/dmnemec/copy_file_to_another_repo_action/issues/39#issuecomment-943845794_.

TomoeMami commented 3 years ago

you meant git_server instead of github_server, right?

After checking code again, I found the problem.

In the action.yml, inputs gets variable git_server, but in the args, it turned out to be github-server

inputs:
  git_server:
......
runs:
  args:
    - ${{ inputs.github-server }}

And in the entrypoint.sh:

git clone --single-branch --branch $INPUT_DESTINATION_BRANCH "https://x-access-token:$API_TOKEN_GITHUB@$INPUT_GITHUB_SERVER/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR"

So that's why we should set github_server instead of git_server

technorabilia commented 3 years ago

Having the same issue.

Unfortunately, setting github_server or git_server to 'github.com' does not work for me.

DominiqueMakowski commented 3 years ago

~I confirm having the same issue~

It works by setting the current unmerged PR as the base action: uses: TomoeMami/copy_file_to_another_repo_action@main and then using git_server as the input variable.

dmnemec commented 2 years ago

@stetttho Yeah, sorry about that. Not sure how it passed my tests. I'll check tonight if it somehow worked and shouldn't have. I'm not on Github much since my work uses a private one so I'm a little slower to respond to these things. Feel free to check out #47 though and give feedback.

dmnemec commented 2 years ago

Just realized the PR that caused it was merged from an outside repo so it didn't run checks on it until the merge faceplam