Skip to content

Commit

Permalink
updated report formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Feb 7, 2025
1 parent 9357578 commit 6970295
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/NightlyBMDB_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,29 @@ jobs:
path: ${{ github.workspace }}/tracer.json

- name: Post results to slack part 1 (report.md from exec-report CLI command)
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
run: |
echo "Word Count $(wc -c < ${GITHUB_WORKSPACE}/report.md)"
if [[ $(wc -c < ${GITHUB_WORKSPACE}/report.md) -lt 2970 ]]; then
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="BMDB Results:" https://slack.com/api/chat.postMessage
curl -X POST -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" -H "Content-type: application/json" \
--data '{
"channel": "${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "```${{ env.REPORT_CONTENT }}\n```"
}
}
]
}' https://slack.com/api/chat.postMessage
else
# Results too long to be formatted
echo "Results too long to format with code block"
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="BMDB Results:" https://slack.com/api/chat.postMessage
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
fi
# Not currently working
- name: Post results to slack part 2 (sound alarm if changed results)
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/NightlyPublished_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ jobs:
- name: Post results to slack part 1 (report.md from exec-report CLI command)
run: |
echo "Word Count $(wc -c < ${GITHUB_WORKSPACE}/report.md)"
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Published Results:" https://slack.com/api/chat.postMessage
if [[ $(wc -c < ${GITHUB_WORKSPACE}/report.md) -lt 2970 ]]; then
curl -X POST -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" -H "Content-type: application/json" \
--data '{
Expand All @@ -398,7 +399,8 @@ jobs:
else
# Results too long to be formatted
echo "Results too long to format with code block"
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Published Results:\n$(cat ${GITHUB_WORKSPACE}/report.md)" https://slack.com/api/chat.postMessage
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Published Results:" https://slack.com/api/chat.postMessage
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
fi
Expand Down

0 comments on commit 6970295

Please sign in to comment.