diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index 65e8738d0d..f53265d99a 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -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}", diff --git a/web/src/lib/api/index.ts b/web/src/lib/api/index.ts index 55455b3943..aebd05120f 100644 --- a/web/src/lib/api/index.ts +++ b/web/src/lib/api/index.ts @@ -89,8 +89,8 @@ export default class WoodpeckerClient extends ApiClient { return this._post(`/api/repos/${repoId}/repair`); } - async createPipeline(repoId: number, options: PipelineOptions): Promise { - return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise; + async createPipeline(repoId: number, options: PipelineOptions): Promise { + return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise; } // Deploy triggers a deployment for an existing pipeline using the diff --git a/web/src/views/repo/RepoManualPipeline.vue b/web/src/views/repo/RepoManualPipeline.vue index d698a0b4d9..5330f20266 100644 --- a/web/src/views/repo/RepoManualPipeline.vue +++ b/web/src/views/repo/RepoManualPipeline.vue @@ -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; }