I was trying to make git clone with Github Action on a private repo, but I am not sure how should I configure it to connect to GitHub with SSH. It is a macOS runner by the way.
At this moment, the actions/checkout is working fine but when I call git clone directly, this error is thrown.
The .yml file is provided below:
name: Release IOS
on:
push:
branches:
- github-action
jobs:
build:
name: Build IPA and upload to TestFlight
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Check Github User
run: |
git --version
git config user.name 'MyUsername'
git config user.email 'MyEmail'
git config user.name
git config user.email
env:
NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.17.0
env:
NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Set up SSH
uses: pioug/la-cle@v1.1.0
with:
GH_SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Try copy a private repo
run: git clone https://github.com/MyUsername/MyRepo.git