From 8f5495f07bee9f2227a094d9803251325ec020c9 Mon Sep 17 00:00:00 2001 From: AnJia Date: Fri, 31 Dec 2021 11:18:29 +0800 Subject: [PATCH] Update gcr.io_mirror.yml --- .github/workflows/gcr.io_mirror.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gcr.io_mirror.yml b/.github/workflows/gcr.io_mirror.yml index c71c97f..8ccf6df 100644 --- a/.github/workflows/gcr.io_mirror.yml +++ b/.github/workflows/gcr.io_mirror.yml @@ -121,11 +121,15 @@ jobs: state: 'closed' }) console.log("update issues resp:", issuesResponse["status"] == 200 ? "success" : "failed" ) + let body = "转换失败,详见 [构建任务](https://github.com/${{ env.GH_USER }}/${{ env.REPO_NAME }}/actions/runs/${{ github.run_id }})" + if(${{ success() }}){ + body = "转换完成
\n```bash \n#原镜像\n${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}\n\n\n#转换后镜像\n${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }}\n\n\n#下载并重命名镜像\ndocker pull ${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }}\ndocker tag ${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }} ${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}\ndocker images | grep $(echo ${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}|awk -F':' '{print $1}')\n```" + } const issuesComment = await github.issues.createComment({ owner: '${{ env.GH_USER }}', repo: '${{ env.REPO_NAME }}', issue_number: ${{ steps.pullIssuesPorter.outputs.ISSUE_NUMBER }}, - body: "转换完成
\n```bash \n#原镜像\n${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}\n\n\n#转换后镜像\n${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }}\n\n\n#下载并重命名镜像\ndocker pull ${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }}\ndocker tag ${{ steps.transferImage.outputs.MY_DOCKER_IMAGE_NAME }} ${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}\ndocker images | grep $(echo ${{ steps.pullIssuesPorter.outputs.GCR_IMAGE }}|awk -F':' '{print $1}')\n```" + body: body }); console.log("create issues comment resp:", issuesComment["status"] == 201 ? "success" : "failed" ) }