Add auth to Git.#Repository
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
@@ -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 & {
|
||||
|
Reference in New Issue
Block a user