diff --git a/mkdocsPublisher/main.ts b/mkdocsPublisher/main.ts index 2b8c83ef..ee844b15 100644 --- a/mkdocsPublisher/main.ts +++ b/mkdocsPublisher/main.ts @@ -40,6 +40,7 @@ export default class MkdocsPublication extends Plugin { const publishSuccess = await publish.publish(file, true); if (publishSuccess) { + new Notice('Send "' + file.basename + '" to ' + this.settings.githubRepo + ".\nNow, waiting for the workflow to be completed...") await publish.workflowGestion(); new Notice( "Successfully published " + @@ -83,6 +84,7 @@ export default class MkdocsPublication extends Plugin { const publishSuccess = await publish.publish(view.file, true); if (publishSuccess) { + new Notice('Send "' + view.file.basename + '" to ' + this.settings.githubRepo + ".\nNow, waiting for the workflow to be completed...") await publish.workflowGestion(); new Notice( "Successfully published " + @@ -127,6 +129,7 @@ export default class MkdocsPublication extends Plugin { true ); if (publishSuccess) { + new Notice('Send "' + currentFile.basename + '"to ' + this.settings.githubRepo + ".\nNow, waiting for the workflow to be completed...") publishFile.workflowGestion(); new Notice( "Successfully published " + @@ -192,11 +195,16 @@ export default class MkdocsPublication extends Plugin { } statusBar.finish(8000); new Notice( - `Successfully published ${ + `Send ${ publishedFiles.length - errorCount } notes to ${this.settings.githubRepo}` ); await publish.workflowGestion(); + new Notice( + `Successfully published ${ + publishedFiles.length - errorCount + } notes to ${this.settings.githubRepo}.\nNow, waiting for the workflow to be completed...` + ); } } catch (e) { // statusBarItems.remove(); diff --git a/mkdocsPublisher/utils/publication.ts b/mkdocsPublisher/utils/publication.ts index 6bbd7e4f..dc69729c 100644 --- a/mkdocsPublisher/utils/publication.ts +++ b/mkdocsPublisher/utils/publication.ts @@ -164,6 +164,21 @@ export default class MkdocsPublish { workflow_id: 'ci.yml', ref: 'main' }) + let finished = false; + while (!finished) { + await sleep(10000) + const workflowGet=await octokit.request('GET /repos/{owner}/{repo}/actions/runs', { + owner: this.settings.githubName, + repo: this.settings.githubRepo + }); + if (workflowGet.data.workflow_runs.length > 0) { + const build = workflowGet.data.workflow_runs.find(run => run.name === 'ci') + if (build.status === 'completed') { + finished = true + } + } + } + } async updateSettings () {