GuillaumeFalourd / clone-github-repo-action

Github Action to clone a public or private Github repository and access its content on others repositories' workflows ♻️
https://github.com/marketplace/actions/clone-github-repo-action
Apache License 2.0
47 stars 20 forks source link

How to clone repo with path name? #3

Open DaviMenezes opened 2 years ago

DaviMenezes commented 2 years ago

git clone .../owner/myrepo MyPath/MyRepo

GuillaumeFalourd commented 2 years ago

Hi @DaviMenezes , thank you for opening this issue! The action currently doesn't support to clone with PATH name, and that would be a great feature indeed! 👍🏼 I'll see how to perform this asap and let you know once it will be implemented.

GuillaumeFalourd commented 2 years ago

@DaviMenezes I've created a v3 branch to test a path-to-clone input field. Could you try it and give me a feedback? It should work on all 3 OS runners. Here is a syntax example:

  uses: GuillaumeFalourd/clone-github-repo-action@v3
  with:
    owner: <owner>
    repository: <repo-name>
    path-to-clone: <path/to/clone>

If not informed, the repository will be cloned where the action is used.

GuillaumeFalourd commented 2 years ago

Hi @DaviMenezes , do you have any feedback?

I've made a test:

Where it seems to work as expected, but I would love to have more returns about the feature.

shishodiyas commented 2 years ago

If not informed, the repository will be cloned where the action is used.

I'm using this to clone a repo inside an workflow and the path which is provided to it is not used and it is deleting all the exiting files in the repos that was checkout out by the workflow file. instead of cloning the repo

shishodiyas commented 2 years ago

why does it delete the content of existing workflow. it is used in my repo for some work how to by pass this deletion Screenshot (26) ?

GuillaumeFalourd commented 2 years ago

Hi @satyamshishodiya!

I didn't understand why the action was deleting the repository neither, so I made a few researches and it seems related to a github actions/checkout (which I use to access the repository github.workspace variable if needed) behavior. There is an issue speaking about it here: https://github.com/actions/checkout/issues/211

Are you using containers in your workflow?

I also found this other issue: https://github.com/actions/checkout/issues/430#issuecomment-764445919 where it is suggested to use the input clean: false when calling the actions/checkout, but as it won't work the first time, I would like to see if there is another solution before using this one.

shishodiyas commented 2 years ago

There are no containers in my workflow.

GuillaumeFalourd commented 2 years ago

Hi @shishodiyas , did you try the other workarounds suggested in the link I shared as well?

shishodiyas commented 2 years ago

Hi tried various methods this issue is still pending.

GuillaumeFalourd commented 2 years ago

For what I can say, it doesn't seem related specifically to the clone operation inside the action, but to the action/checkout. Now, if you want to share the workflow you were using, I can perform more tests to check.

shishodiyas commented 2 years ago

It's a private repository so I can't. But I can share the workflow file. Only!!

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Guillaume Falourd @.> Sent: Wednesday, June 22, 2022 11:03:08 PM To: GuillaumeFalourd/clone-github-repo-action @.> Cc: Satyam Singh Shishodiya @.>; Mention @.> Subject: Re: [GuillaumeFalourd/clone-github-repo-action] How to clone repo with path name? (Issue #3)

For what I can say, it doesn't seem related specifically to the clone operation inside the action, but to the action/checkout. Now, if you want to share the workflow you were using, I can perform more tests to check.

— Reply to this email directly, view it on GitHubhttps://github.com/GuillaumeFalourd/clone-github-repo-action/issues/3#issuecomment-1163417924, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYTDXWXY4OQWQM2DKYK47CDVQNE5JANCNFSM5UNDBTJA. You are receiving this because you were mentioned.Message ID: @.***>

GuillaumeFalourd commented 2 years ago

The workflow file would be enough 👍🏼