I have a private CocoaPods spec repo that my project relies on to run pod install.
I'm trying to automate my build process using GitHub Actions. However, since the spec repo is private, I'm having trouble getting access to it in this other project.
I have tried the following code:
- name: Clone private-cocoapods-spec
uses: actions/checkout@v2
with:
repository: fishcharlie/Private-CocoaPods-Spec
ref: refs/heads/master
# GitHub's personal access token with access to `my-organization/awesome-action`
token: ${{ secrets.GH_ACCESS_TOKEN }}
persist-credentials: false
path: /Users/runner/.cocoapods/repos/private-cocoapods-spec
Sadly this produces the following error:
Repository path '/Users/runner/.cocoapods/repos/private-cocoapods-spec' is not under '/Users/runner/work/Project/Project'
I also tried the following based on this Stack Overflow answer:
- name: Configure git
env:
TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
However this didn't work either and produced the following error:
Cloning spec repo `private-cocoapods-spec` from `git@github.com:fishcharlie/Private-CocoaPods-Spec.git`
[!] Unable to add a source with url `git@github.com:fishcharlie/Private-CocoaPods-Spec.git ` named `private-cocoapods-spec`.
You can try adding it manually in `/Users/runner/.cocoapods/repos` or via `pod repo add`.
I'm assuming this is because I'm trying to use SSH instead of HTTPS to authenticate.
What is the best method to achieve this and have access to my private cocoapods-spec so that my pod install command will succeed?