Add auth to Git.#Repository

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville
2021-08-26 16:12:14 +02:00
parent 3b0e3f6919
commit 08f395b70d
9 changed files with 55 additions and 43 deletions

View File

@@ -11,18 +11,24 @@ import (
#Repository: {
// Git remote.
// Example: `"https://github.com/dagger/dagger"`
remote: string & dagger.#Input
remote: dagger.#Input & {string}
// Git ref: can be a commit, tag or branch.
// Example: "main"
ref: string & dagger.#Input
ref: dagger.#Input & {string}
// (optional) Subdirectory
subdir: *null | string & dagger.#Input
subdir: dagger.#Input & {*null | string}
// (optional) Keep .git directory
keepGitDir: *false | bool
// (optional) Add Personal Access Token
authToken: dagger.#Input & {*null | dagger.#Secret}
// (optional) Add OAuth Token
authHeader: dagger.#Input & {*null | dagger.#Secret}
#up: [
op.#FetchGit & {
"remote": remote
@@ -30,6 +36,12 @@ import (
if (keepGitDir) {
keepGitDir: true
}
if (authToken != null) {
"authToken": authToken
}
if (authHeader != null) {
"authHeader": authHeader
}
},
if subdir != null {
op.#Subdir & {