name: Notify Workflow Results on: workflow_run: workflows: - Publish Supported Platform Target - DSH Candidate Validation types: - completed permissions: contents: read jobs: notify-result: name: Notify completed workflow result if: >- (github.event.workflow_run.name == 'Publish Supported Platform Target' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure')) || (github.event.workflow_run.name == 'DSH Candidate Validation' && (github.event.workflow_run.event == 'pull_request_target' || github.event.workflow_run.event == 'workflow_dispatch') && github.event.workflow_run.head_branch != 'automation/dsh-upstream-candidate' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure')) uses: yjrszcq/github-workflows/.github/workflows/gotify-notify.yml@c4c7fe9e17854cd4962913ac2792513eab0be988 with: title: >- ${{ github.event.workflow_run.name == 'Publish Supported Platform Target' && (github.event.workflow_run.conclusion == 'success' && 'DSH 正式目标已发布' || 'DSH 正式发布失败') || (github.event.workflow_run.conclusion == 'success' && 'DSH 候选版本验证通过' || 'DSH 候选版本验证失败') }} message: >- ${{ github.event.workflow_run.name == 'Publish Supported Platform Target' && (github.event.workflow_run.conclusion == 'success' && format('签名目标和必要的 Environment Release 已发布。独立镜像工作流已经启动;如果 production-image 启用了审批,镜像发布会等待批准。镜像工作流:{0}/{1}/actions/workflows/docker.yaml', github.server_url, github.repository) || format('签名目标或 Environment Release 发布失败。工作流:{0}', github.event.workflow_run.html_url)) || (github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.event == 'workflow_dispatch' && format('手动发起的 DSH 候选版本兼容性验证通过。候选提交:{0}。工作流:{1}', github.event.workflow_run.head_sha, github.event.workflow_run.html_url) || format('Pull Request 的 DSH 候选版本兼容性验证通过。候选提交:{0}。工作流:{1}', github.event.workflow_run.head_sha, github.event.workflow_run.html_url)) || (github.event.workflow_run.event == 'workflow_dispatch' && format('手动发起的 DSH 候选版本兼容性验证失败。候选提交:{0}。工作流:{1}', github.event.workflow_run.head_sha, github.event.workflow_run.html_url) || format('Pull Request 的 DSH 候选版本兼容性验证失败。候选提交:{0}。工作流:{1}', github.event.workflow_run.head_sha, github.event.workflow_run.html_url))) }} priority: ${{ github.event.workflow_run.conclusion == 'failure' && 8 || 7 }} secrets: gotify_url: ${{ secrets.GOTIFY_URL }} gotify_token: ${{ secrets.GOTIFY_TOKEN }}