generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add git credentials as input parameter (#54)
* add git credentials as input parameter * update test.yml to work with new argument
- Loading branch information
1 parent
30ecad1
commit 7257a18
Showing
4 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ The action has three optional inputs | |
* `log-level`: The log level to use for `cargo-deny`, default is `warn` | ||
* `command`: The command to use for `cargo-deny`, default is `check` | ||
* `arguments`: The argument to pass to `cargo-deny`, default is `--all-features`. See [Common Options](https://embarkstudios.github.io/cargo-deny/cli/common.html) for a list of the available options. | ||
* `command-arguments` The argument to pass to the command, default is emtpy. See options for [each command](https://embarkstudios.github.io/cargo-deny/cli/index.html). | ||
* `command-arguments` The argument to pass to the command, default is emtpy. See options for [each command](https://embarkstudios.github.io/cargo-deny/cli/index.html). | ||
* `credentials` This argument stores the credentials in the file `$HOME/git-credentials`, and configures git to use it. The credential must match the format `https://user:[email protected]` | ||
|
||
### Example pipeline | ||
|
||
|
@@ -54,6 +55,7 @@ jobs: | |
command: check | ||
arguments: --all-features | ||
command-arguments: "" | ||
credentials: https://${{ secrets.GITHUB_USER }}:${{ secrets.GITHUB_PAT }}@github.com | ||
``` | ||
### Use specific Rust version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,17 @@ then | |
rustup default "$1" | ||
fi | ||
|
||
if [ -n "$2" ] | ||
then | ||
git config --global credential.helper store | ||
git config --global --replace-all url.https://github.com/.insteadOf ssh://[email protected]/ | ||
git config --global --add url.https://github.com/.insteadOf [email protected]: | ||
|
||
echo $2 > $HOME/.git-credentials | ||
chmod 600 $HOME/.git-credentials | ||
fi | ||
|
||
shift | ||
shift | ||
|
||
cargo-deny $* |