question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using this action with private repositories and registries

See original GitHub issue

Hi!

This issue might have nothing to do with this action itself, just my lack of understanding of how actions work. Maybe it is a request for new documentation or sample?

So my setup is that I have a repository called vcpkg-registry. I have configured a couple of vcpkg ports there, and in my main application project I have setup that registry to be used as a source for my shared library project. All of these repos are private. Now when I attempt to use my pipeline (that is pretty much copy paste the hosted-basic example) I of course get this error:

Fetching baseline information from https://github.com/lerppana/vcpkg-registry...
 Error: Couldn't find baseline "89f7510a4c0431b03a4012ec7011986b0b1dd150" for repo https://github.com/lerppana/vcpkg-registry:
  fatal: not a git repository: 'C:\Users\runneradmin\AppData\Local\vcpkg\registries\git\.git'

  Error: Failed to fetch https://github.com/lerppana/vcpkg-registry:
  Error: Failed to fetch ref 89f7510a4c0431b03a4012ec7011986b0b1dd150 from repository https://github.com/lerppana/vcpkg-registry.
  fatal: Cannot prompt because user interactivity has been disabled.
  bash: /dev/tty: No such device or address
  error: failed to execute prompt script (exit code 1)
  fatal: could not read Username for 'https://github.com': No such file or directory

So my question is if this action is able to use private repo registries? Is it just matter of configuring login credentials for git in runner, or is there some proper way to achieve this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lukkacommented, Sep 28, 2021

@lerppana awesome! In the future I’d like to create a sample showing vcpkg-registry working with private repos. Thanks for finding a working solution and refining it!

1reaction
lerppanacommented, Sep 28, 2021

Thanks @lukka for pointing those threads for me, it clarified the issue for me. I picked up two different methods that were discussed there which both worked fine:

#      method 1
      - run: echo "url=https://github.com"$'\n'"path=lerppana/vcpkg-registry"$'\n'"username=unused"$'\n'"password=${{ secrets.PAT }}"$'\n' | git credential approve
        shell: bash
        name: 'git credential approve'

#      method 2
      - run: git config --global credential.helper '!f() { echo username=unused; echo password=${{ secrets.PAT }}; }; f'
        shell: bash
        name: 'git credential helper setup'

both of them work with personal access tokens, I believe method 1 allows to set PAT per repo because path is given as parameter (which could be handy). It is bash script, but works fine with windows agent for me when shell: bash is specified. Otherwise it tries to default to pw.

EDIT: I´ll close the issue as it is now fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Actions: Private registry support for job and service ...
Job and Service containers in GitHub Actions allow you to containerize your CI environment and make databases, caches, or other services ...
Read more >
Integrating a private registry with GitHub Actions - Bytesafe
If you are using GitHub Actions as the CI/CD service for your build chain, you may be looking for a way to include...
Read more >
Amazon ECR private repositories
Amazon Elastic Container Registry (Amazon ECR) provides API operations to create, monitor, and delete image repositories and set permissions that control ...
Read more >
docker - Login github package registry in private repository ...
You have to add credentials to each service where you use an image from a private repository. From the docs:.
Read more >
Using Private Repositories and Registries :: Tekton Tutorial
Use Tekton Authentication Secrets. How to push linux container image to external registry. How to clone from a private Github respository ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found