1
0
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:
qwerty287
2025-12-20 09:11:36 +01:00
committed by GitHub
parent a17de54a83
commit 216878d13d
3 changed files with 20 additions and 9 deletions
+2 -1
View File
@@ -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}",
+2 -2
View File
@@ -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
+16 -6
View File
@@ -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;
}