sudara / pamplejuce

A JUCE audio plugin template. JUCE 8, Catch2, Pluginval, macOS notarization, Azure Trusted Signing, Github Actions
https://melatonin.dev/manuals/pamplejuce
MIT License
429 stars 43 forks source link

cmake_ctest.yml : fails to clone private submodule #58

Closed mikelange49 closed 12 months ago

mikelange49 commented 1 year ago

Hi

I'm trying to add a submodule from a private repo. This submodule, as well as my pamplejuce project, are in a github organization.

cmake_ctest.yml action fails on cloning that repo : remote: Repository not found.

For now I'm trying to fix it using webfactory/ssh-agent If I succeed, I'll post here.

Meanwhile, if anyone has already done it, please share.

mikelange49 commented 1 year ago

This worked for me :

I replaced

    - name: Checkout code
      uses: actions/checkout@v3
      with:
        submodules: true # Get JUCE populated

with

    - name: Checkout code (no submodules)
      uses: actions/checkout@v3

    - name: Add SSH private keys for submodule repositories
      uses: webfactory/ssh-agent@v0.7.0
      with:
        ssh-private-key: |
          ${{ secrets.PRIVATE_REPO_1_SECRET }}
          ${{ secrets.PRIVATE_REPO_2_SECRET }}

    - name: Update submodules
      run: git submodule update --init --recursive

Useful help :

https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions/70283191#70283191

https://github.com/webfactory/ssh-agent#support-for-github-deploy-keys

https://github.com/actions/checkout/issues/287#issuecomment-1398500696

@sudara Shall I close the issue ? Or would you like to try it and update cmake_ctest.yml if it works ?

sudara commented 1 year ago

Glad you figured it out!

Let's leave this open for now. I'll tag it for some improved documentation I'm thinking about writing. The only other way I can think of including it in the repo is to have a commented out example (unideal for the main yml).... I am thinking about breaking apart the yml similarly to the cmake though...