From b895c36713d01ce35dde3226a1cb8d9b0cad85b8 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Wed, 25 Aug 2021 15:29:09 +0300 Subject: [PATCH] Update Send Slack notification step to send a custom message --- .github/workflows/get-go-versions.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/get-go-versions.yml b/.github/workflows/get-go-versions.yml index 57dc565..bd14f8e 100644 --- a/.github/workflows/get-go-versions.yml +++ b/.github/workflows/get-go-versions.yml @@ -50,12 +50,11 @@ jobs: - name: Send Slack notification run: | $pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID" + $message = "The following versions of '${{ env.TOOL_NAME }}' are available to upload: ${{ env.TOOL_VERSIONS }}\nLink to the pipeline: $pipelineUrl" ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" ` -ToolName "${{ env.TOOL_NAME }}" ` - -ToolVersion "${{ env.TOOL_VERSIONS }}" ` - -PipelineUrl "$pipelineUrl" ` - -ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg" - + -ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg" ` + -Text "$message" trigger_builds: name: Trigger builds runs-on: ubuntu-latest @@ -90,8 +89,8 @@ jobs: - name: Send Slack notification if build fails run: | $pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID" - $Message = "The build of the '${{ env.TOOL_NAME }}' detection pipeline failed :progress-error:\nLink to the pipeline: $pipelineUrl" + $message = "The build of the '${{ env.TOOL_NAME }}' detection pipeline failed :progress-error:\nLink to the pipeline: $pipelineUrl" ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" ` -ToolName "${{ env.TOOL_NAME }}" ` - -Text "$Message" ` + -Text "$message" ` -ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg"