Skip to content

Commit

Permalink
Attempting to fix "no text" error
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Jan 31, 2025
1 parent e9b00be commit 3da8914
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/NightlyBMDB_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ 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="```$(cat ${GITHUB_WORKSPACE}/report.md)```" https://slack.com/api/chat.postMessage
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

# Not currently working
- name: Post results to slack part 2 (sound alarm if changed results)
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/NightlyPublished_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
echo "Extracting tests"
MAX_NUM_FILES=20
MAX_NUM_FILES=2000
file_num=1
for file in $SOURCE_DIR/*; do
if [[ "$file_num" -eq "$MAX_NUM_FILES" ]]; then
Expand Down Expand Up @@ -375,8 +375,32 @@ jobs:
- name: Show results)
run: echo "$(cat ${GITHUB_WORKSPACE}/report.md)"

- name: Read report file into GH env variable
run: echo "REPORT_CONTENT<<EOF" >> $GITHUB_ENV && cat ${{ github.workspace }}/report.md >> $GITHUB_ENV && echo "EOF" >> $GITHUB_ENV

- 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="```$(cat ${GITHUB_WORKSPACE}/report.md)```" https://slack.com/api/chat.postMessage
run: |
if [[ "$(cat ${GITHUB_WORKSPACE}/report.md) | wc -c | awk '{ print $1; }'" -lt "2970" ]]; then
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": "```\nPublished Results:\n${{ 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="$(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

0 comments on commit 3da8914

Please sign in to comment.