projects: add checkbox to pass variables to forked PR
This commit is contained in:
parent
2878905257
commit
b7dfeddcbb
|
@ -14,7 +14,12 @@
|
|||
Private
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" v-model="pass_vars_to_forked_pr" />
|
||||
Pass variables to run even if triggered by PR from forked repo (DANGEROUS)
|
||||
</label>
|
||||
</div>
|
||||
<div class="mb-3 flex items-center">
|
||||
<div class="flex relative w-64">
|
||||
<select
|
||||
|
@ -165,7 +170,8 @@ export default {
|
|||
this.projectName,
|
||||
visibility,
|
||||
remoteSource.name,
|
||||
this.remoteRepoPath
|
||||
this.remoteRepoPath,
|
||||
this.pass_vars_to_forked_pr
|
||||
);
|
||||
this.stopProjectLoading();
|
||||
if (error) {
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
Private
|
||||
</label>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" v-model="project.pass_vars_to_forked_pr" />
|
||||
Pass variables to run even if triggered by PR from forked repo (DANGEROUS)
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-blue" @click="updateProject()">Update</button>
|
||||
<div
|
||||
v-if="updateProjectError"
|
||||
|
@ -178,7 +184,8 @@ export default {
|
|||
let { error } = await updateProject(
|
||||
projectref,
|
||||
this.project.name,
|
||||
visibility
|
||||
visibility,
|
||||
this.project.pass_vars_to_forked_pr
|
||||
);
|
||||
if (error) {
|
||||
this.updateProjectError = error;
|
||||
|
@ -235,6 +242,7 @@ export default {
|
|||
this.$store.dispatch("setError", error);
|
||||
return;
|
||||
}
|
||||
|
||||
this.project = data;
|
||||
this.projectIsPrivate = this.project.visibility == "private";
|
||||
|
||||
|
|
|
@ -335,6 +335,7 @@ export async function createProject(
|
|||
visibility,
|
||||
remotesourcename,
|
||||
remoterepopath,
|
||||
passvarstoforkedpr,
|
||||
signal
|
||||
) {
|
||||
let path = "/projects";
|
||||
|
@ -345,19 +346,21 @@ export async function createProject(
|
|||
parent_ref: parentref,
|
||||
visibility: visibility,
|
||||
remote_source_name: remotesourcename,
|
||||
repo_path: remoterepopath
|
||||
repo_path: remoterepopath,
|
||||
pass_vars_to_forked_pr: passvarstoforkedpr
|
||||
})
|
||||
};
|
||||
return await fetch(apiurl(path), init, signal);
|
||||
}
|
||||
|
||||
export async function updateProject(projectref, name, visibility, signal) {
|
||||
export async function updateProject(projectref, name, visibility, passvarstoforkedpr, signal) {
|
||||
let path = "/projects/" + encodeURIComponent(projectref);
|
||||
let init = {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({
|
||||
name: name,
|
||||
visibility: visibility
|
||||
visibility: visibility,
|
||||
pass_vars_to_forked_pr: passvarstoforkedpr
|
||||
})
|
||||
};
|
||||
return await fetch(apiurl(path), init, signal);
|
||||
|
|
Loading…
Reference in New Issue