-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use swift-package-dependencies-check with dependencies in private repos? #6
Comments
Hi Martin (@mman), thank for your interest in this GitHub action and for the provided feedback! I am wondering if your use case even works with an older version of this GitHub action which does not make use of
I was not aware of the challenges regarding private repositories. A major difference to action https://github.com/getsidetrack/action-xcodeproj-spm-update is that it does not use Docker but a bash script and therefore rely on the Swift version used in the virtual environment.. If you can verify that an older version of this Docker-based action works for you when using |
The 1.1.0 does not work either with private repositories, since it also uses nested docker step. So any special git/ssh configuration performed in the github job itself is lost and not pushed to the nested docker step. I am currently using I will have time next week to fork and look at what can be done. |
Hi @mman , next week I will also look into using a composite action which I believe did not exist as an action option when I created this GitHub action. In the past I remember there were only Docker or Javascript based GitHub action. But I have my concerns as the user might have to use a specific virtual environment. For example action-xcodeproj-spm-update should fail when running on a Linux environment as it needs xcodebuild |
Hi Marco,
I have many packages that use private SPM dependencies via github.
Common method to allow github workflows to support private dependencies in any form (could be submodule, could be private package via
[email protected]:username/repo
) is to use old school trick of mapping ssh deploy keys and virtual ssh hostnames along with.gitconfig
url...insteadOf
to your private repositories.This can be automated via great action from shaunco: https://github.com/shaunco/ssh-agent/tree/git-repo-mapping.
Here is an example
swift build && swift test
workflow that uses private swift dependencies that I am using:I have tried to use the same approach with your action, but it does not work properly. I have also tried with https://github.com/getsidetrack/action-xcodeproj-spm-update and there it works nicely.
So I started investigating what is the issue and I think I have found it:
The
shaunco/ssh-agent@git-repo-mapping
will populate~/.gitconfig
and~/.ssh/*
of the workflow job with private keys and hostname aliases for all the private dependencies that you may have. The~/.ssh/*
private keys are then added to the workflow internalssh-agent
and used by the subsequent steps. So for examplexcodebuild
used by the https://github.com/getsidetrack/action-xcodeproj-spm-update will pick up the new config nicely and will happily check dependencies and create a PR.But your action will fail because it uses a step to invoke
swift-release-notes
via nesteddocker
and the~/.ssh/config
and~/.gitconfig
are not properly passed to the docker step.I have been able to overcome this limitation by somehow (hard copy, volume mount in case of
docker build
) pushing the~/.ssh
and~/.gitconfig
to the docker step so that it can properly access the private dependencies, but I have not found an easy way to do this with your workflow without forking and modifying it heavily.I am not necessarily suggesting I know how to fix this properly, but I just want the issue to exist here for anybody hitting the same limitation.
I will probably try to work around this limitation by skipping the
swift-release-notes
binary invocation, and by simply invokingswift package update
directly and comparing the md5sum before/after the same wayaction-xcodeproj-spm-update
does it.Another option could be to build
swift-release-notes
directly inside the job, and thus avoiding jumping to another nested docker step, which will help inherit the job environment.Thoughts?
The text was updated successfully, but these errors were encountered: