From cea71dc4b6ddd72190e0be0c4d0a4c3028bbe815 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 4 Mar 2021 11:51:50 +0100 Subject: [PATCH 1/4] Add note about using cargo with private dependencies --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 63fccf8..88083c2 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,25 @@ If the private key is not in the `PEM` format, you will see an `Error loading ke Use `ssh-keygen -p -f path/to/your/key -m pem` to convert your key file to `PEM`, but be sure to make a backup of the file first 😉. +### Cargo's (Rust) Private Dependencies + +If you are using private repositories in your dependencies like this: + +``` +stuff = { git = "ssh://git@github.com/myorg/stuff.git", branch = "main" } +``` + +You will need to change a configuration in the workflow in order to make cargo able to clone private repositories. + +Add this step once in your workflow **before** any cargo command: + +``` + - name: Update cargo config to use Git CLI + run: Set-Content -Path $env:USERPROFILE\.cargo\config.toml "[net]`ngit-fetch-with-cli = true" +``` + +This will configure Cargo to use the Git CLI as explained in the [Cargo's documentation](https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli). + ## What this Action *cannot* do for you The following items are not issues, but beyond what this Action is supposed to do. From ab3ae05c6a9d598335f198056193a3ac0ac764eb Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 4 Mar 2021 12:05:20 +0100 Subject: [PATCH 2/4] Update doc to mention Windows only --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88083c2..38cddc1 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ If the private key is not in the `PEM` format, you will see an `Error loading ke Use `ssh-keygen -p -f path/to/your/key -m pem` to convert your key file to `PEM`, but be sure to make a backup of the file first 😉. -### Cargo's (Rust) Private Dependencies +### Cargo's (Rust) Private Dependencies on Windows If you are using private repositories in your dependencies like this: @@ -98,7 +98,7 @@ If you are using private repositories in your dependencies like this: stuff = { git = "ssh://git@github.com/myorg/stuff.git", branch = "main" } ``` -You will need to change a configuration in the workflow in order to make cargo able to clone private repositories. +You will need to change a configuration in the workflow for Windows machines in order to make cargo able to clone private repositories. Add this step once in your workflow **before** any cargo command: From 6017ae2317bc0020d683648914baff59c935fb16 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 4 Mar 2021 12:29:57 +0100 Subject: [PATCH 3/4] Add alternative workaround --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 38cddc1..01eab3f 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,9 @@ stuff = { git = "ssh://git@github.com/myorg/stuff.git", branch = "main" } You will need to change a configuration in the workflow for Windows machines in order to make cargo able to clone private repositories. -Add this step once in your workflow **before** any cargo command: +There are 2 ways you can achieve this: + +1. Add this step once in your job **before** any cargo command: ``` - name: Update cargo config to use Git CLI @@ -109,6 +111,13 @@ Add this step once in your workflow **before** any cargo command: This will configure Cargo to use the Git CLI as explained in the [Cargo's documentation](https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli). +2. Alternatively you can set it to the environment variables for the entire workflow: + +``` +env: + CARGO_NET_GIT_FETCH_WITH_CLI: true +``` + ## What this Action *cannot* do for you The following items are not issues, but beyond what this Action is supposed to do. From f13a8233d597eb4559b72176ded15f56331d262d Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 4 Mar 2021 11:22:21 +0000 Subject: [PATCH 4/4] Create extra main section for tips and information regarding different languages/tools --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01eab3f..0a49485 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,10 @@ If the private key is not in the `PEM` format, you will see an `Error loading ke Use `ssh-keygen -p -f path/to/your/key -m pem` to convert your key file to `PEM`, but be sure to make a backup of the file first 😉. +## Additional Information for Particular Tools or Platforms + +If you know that your favorite tool or platform of choice requires extra tweaks or has some caveats when running with SSH, feel free to open a PR to amend this section here. + ### Cargo's (Rust) Private Dependencies on Windows If you are using private repositories in your dependencies like this: @@ -98,7 +102,7 @@ If you are using private repositories in your dependencies like this: stuff = { git = "ssh://git@github.com/myorg/stuff.git", branch = "main" } ``` -You will need to change a configuration in the workflow for Windows machines in order to make cargo able to clone private repositories. +... you will need to change a configuration in the workflow for Windows machines in order to make cargo able to clone private repositories. There are 2 ways you can achieve this: