You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-06-03 16:35:37 +02:00
Show warning if there is no workflow to run (#5883)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com> Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
@@ -48,7 +48,8 @@
|
||||
"name": "Variable name",
|
||||
"value": "Variable value"
|
||||
},
|
||||
"show_pipelines": "Show pipelines"
|
||||
"show_pipelines": "Show pipelines",
|
||||
"no_manual_workflows": "There were no manually executable workflows, or the filter exclude all of them."
|
||||
},
|
||||
"deploy_pipeline": {
|
||||
"title": "Trigger a deployment for current pipeline #{pipelineId}",
|
||||
|
||||
@@ -89,8 +89,8 @@ export default class WoodpeckerClient extends ApiClient {
|
||||
return this._post(`/api/repos/${repoId}/repair`);
|
||||
}
|
||||
|
||||
async createPipeline(repoId: number, options: PipelineOptions): Promise<Pipeline> {
|
||||
return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise<Pipeline>;
|
||||
async createPipeline(repoId: number, options: PipelineOptions): Promise<Pipeline | string> {
|
||||
return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise<Pipeline | string>;
|
||||
}
|
||||
|
||||
// Deploy triggers a deployment for an existing pipeline using the
|
||||
|
||||
@@ -95,12 +95,22 @@ async function triggerManualPipeline() {
|
||||
|
||||
emit('close');
|
||||
|
||||
await router.push({
|
||||
name: 'repo-pipeline',
|
||||
params: {
|
||||
pipelineId: pipeline.number,
|
||||
},
|
||||
});
|
||||
if (typeof pipeline == 'string') {
|
||||
// if this is a string (http 204) there is no workflow to run with the 'manual' event
|
||||
|
||||
await router.push({
|
||||
name: 'repo',
|
||||
});
|
||||
|
||||
notifications.notify({ type: 'warn', title: i18n.t('repo.manual_pipeline.no_manual_workflows') });
|
||||
} else {
|
||||
await router.push({
|
||||
name: 'repo-pipeline',
|
||||
params: {
|
||||
pipelineId: pipeline.number,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user