Giter Club home page Giter Club logo

Comments (19)

TingluoHuang avatar TingluoHuang commented on June 15, 2024 150

@maxperrimond try to generate a PAT and set that as repository secret, use that to clone the extra repository, the GITHUB_TOKEN is scope to the workflow repo.
Ex:

      - name: Check out my other private repo
        uses: actions/checkout@master
        with:
          repository: orgname/reponame
          token: ${{ secrets.my_pat }}

from checkout.

TingluoHuang avatar TingluoHuang commented on June 15, 2024 92

Yes, you can

steps:
- uses: actions/checkout@master
  with:
    name: org1/repo1     <-- clone https://github.com/org1/repo1
    ref: refs/heads/release

from checkout.

maxperrimond avatar maxperrimond commented on June 15, 2024 44

I tried to clone another private repository with the action but I only get:

##[error]fatal: repository 'https://github.com/orgname/reponame/' not found

step:

      - name: Check out my other private repo
        uses: actions/checkout@master
        with:
          repository: orgname/reponame

I tried to pass the github token but doesn't change the outcome.

from checkout.

hohserg1 avatar hohserg1 commented on June 15, 2024 15

@orelviz yes.
I use a path parameter of actions/checkout to specify cloning location.
https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml#L21
Next I use a --project-dir command line parameter of gradle to specify root location of gradle workspace
https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml#L55
Link to this yml been posted above

from checkout.

rogerprz avatar rogerprz commented on June 15, 2024 12

If it's from another source outside of github do we use the full URL?

from checkout.

hohserg1 avatar hohserg1 commented on June 15, 2024 11

I want to clone multiple repos for together build. How to prevent deleting of prev-cloned repo?
image
It's my configuration: https://github.com/ElegantNetworking/ElegantNetworkingRoot/blob/master/.github/workflows/gradle.yml
Can anyone help?

from checkout.

garvit-joshi avatar garvit-joshi commented on June 15, 2024 10

Can we checkout or clone a gitlab repo?

from checkout.

CaseyLabs avatar CaseyLabs commented on June 15, 2024 8

This is for anyone coming here from a Google search.

If you receive the following error when trying to clone a public git repo with Github Actions (whether it's on Github or Gitlab or elsewhere):

An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')
return code: 128
expected return code: 0
stdout: (none)
stderr:
    fatal: unable to connect to github.com:
    github.com[0: 140.82.113.4]: errno=Connection timed out

You need to configure git to clone using HTTPS, and not SSH:

git config --global url.https://github.com/.insteadOf git://github.com/

Example:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      
      - name: Run shell commands
        run: |
          git config --global url.https://github.com/.insteadOf git://github.com/
          git clone https://github.com/githubtraining/hellogitworld.git

from checkout.

hohserg1 avatar hohserg1 commented on June 15, 2024 6

Ok, now I solve cloning multiple repos by using path.
But I have a problem with running gradle from inner directory
'cd' command is not work
image

from checkout.

blane1988 avatar blane1988 commented on June 15, 2024 4

@rogerprz did you get it to work with a repo outside of github.com?

I am also wondering if we can clone from another domain besides the one where this action is called. In my case, the domain is githubdev, and I want to clone from regular old github.com.

Currently, this action appends the githubdev domain to the repo arg for the action (org/repo) leading to an incorrect full URL.

from checkout.

orelviz avatar orelviz commented on June 15, 2024 1

@hohserg1 can you elaborate on how you solved it? Can you share youre .yml file?

from checkout.

mochadwi avatar mochadwi commented on June 15, 2024 1

Can we checkout or clone a gitlab repo?

+1 asking a same questions

from checkout.

Shindek77 avatar Shindek77 commented on June 15, 2024 1

It worked well. Thanks for your support @TingluoHuang
For me getting below issue: Any suggestions
Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled

from checkout.

maxperrimond avatar maxperrimond commented on June 15, 2024

It worked well. Thanks for your support @TingluoHuang

from checkout.

ChrisChiasson avatar ChrisChiasson commented on June 15, 2024

Thanks

from checkout.

hohserg1 avatar hohserg1 commented on June 15, 2024

Yeeeeah! Solved! --project-dir is cool!

from checkout.

rdreyer-godaddy avatar rdreyer-godaddy commented on June 15, 2024

@rogerprz did you get it to work with a repo outside of github.com?

from checkout.

elect86 avatar elect86 commented on June 15, 2024

@hohserg1 How did you manage to get the clone persistent?

from checkout.

CartBlanche avatar CartBlanche commented on June 15, 2024

Does anyone have a simple example of using both path and clean: false, when trying to checkout another repo at the same level as the currently building repo?
I'm trying to get this..
/currentdev/currentrepo
/currentdev/../siblingrepo
before then building the project in currentrepo.

from checkout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.