1
0
Fork 0
mirror of https://github.com/actions/go-versions synced 2024-11-25 12:32:40 +00:00

Update Send Slack notification step to send a custom message

This commit is contained in:
Nikita Bykov 2021-08-25 15:29:09 +03:00
parent d0f2864c56
commit b895c36713

View file

@ -50,12 +50,11 @@ jobs:
- name: Send Slack notification - name: Send Slack notification
run: | run: |
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID" $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 }}" ` ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
-ToolName "${{ env.TOOL_NAME }}" ` -ToolName "${{ env.TOOL_NAME }}" `
-ToolVersion "${{ env.TOOL_VERSIONS }}" ` -ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg" `
-PipelineUrl "$pipelineUrl" ` -Text "$message"
-ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg"
trigger_builds: trigger_builds:
name: Trigger builds name: Trigger builds
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -90,8 +89,8 @@ jobs:
- name: Send Slack notification if build fails - name: Send Slack notification if build fails
run: | run: |
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID" $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 }}" ` ./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
-ToolName "${{ env.TOOL_NAME }}" ` -ToolName "${{ env.TOOL_NAME }}" `
-Text "$Message" ` -Text "$message" `
-ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg" -ImageUrl "https://golang.org/lib/godoc/images/footer-gopher.jpg"