File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ jobs:
376376 path : ${{ github.workspace }}/tracer.json
377377
378378 - name : Post results to slack part 1 (report.md from exec-report CLI command)
379- run : curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="`` `$(cat ${GITHUB_WORKSPACE}/report.md)`` `" https://slack.com/api/chat.postMessage
379+ run : curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="BMDB Results:\n\`\`\ `$(cat ${GITHUB_WORKSPACE}/report.md)\`\`\ `" https://slack.com/api/chat.postMessage
380380
381381 # Not currently working
382382 - name : Post results to slack part 2 (sound alarm if changed results)
Original file line number Diff line number Diff line change @@ -375,8 +375,32 @@ jobs:
375375 - name : Show results)
376376 run : echo "$(cat ${GITHUB_WORKSPACE}/report.md)"
377377
378+ - name : Read report file into GH env variable
379+ run : echo "REPORT_CONTENT<<EOF" >> $GITHUB_ENV && cat ${{ github.workspace }}/report.md >> $GITHUB_ENV && echo "EOF" >> $GITHUB_ENV
380+
378381 - name : Post results to slack part 1 (report.md from exec-report CLI command)
379- run : curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="```$(cat ${GITHUB_WORKSPACE}/report.md)```" https://slack.com/api/chat.postMessage
382+ run : |
383+ if [[ "$(cat ${GITHUB_WORKSPACE}/report.md) | wc -c | awk '{ print $1; }'" -lt "2970" ]]; then
384+ curl -X POST -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" -H "Content-type: application/json" \
385+ --data '{
386+ "channel": "${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }}",
387+ "blocks": [
388+ {
389+ "type": "section",
390+ "text": {
391+ "type": "mrkdwn",
392+ "text": "```\nPublished Results:\n${{ env.REPORT_CONTENT }}\n```"
393+ }
394+ }
395+ ]
396+ }' https://slack.com/api/chat.postMessage
397+ else
398+ # Results too long to be formatted
399+ echo "Results too long to format with code block"
400+ curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="$(cat ${GITHUB_WORKSPACE}/report.md)" https://slack.com/api/chat.postMessage
401+ fi
402+
403+
380404
381405 # Not currently working
382406 - name : Post results to slack part 2 (sound alarm if changed results)
You can’t perform that action at this time.
0 commit comments