Skip to content

Commit

Permalink
try another approach
Browse files Browse the repository at this point in the history
  • Loading branch information
mayconamaroCW committed Apr 22, 2024
1 parent 5b27ef1 commit 8c00ebf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/outdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ jobs:
id: outdated
run: |
TABLE="$(cat outdated.txt)"
TABLE="${TABLE//$'\n'/\\n}"
TABLE="${TABLE//\"/\\\"}"
TABLE="${TABLE//$'\n'/\\n}" # Escape newlines for JSON
TABLE="${TABLE//\"/\\\"}" # Escape double quotes for JSON
MESSAGE="Stratus outdated crates:\\n\\n\`\`\`${TABLE}\`\`\`"
echo "message=$MESSAGE" >> $GITHUB_ENV
MESSAGE="${MESSAGE//\`/\\\`}" # Escape backticks for JSON
echo "MESSAGE_JSON=$(echo -n "${MESSAGE}" | jq -aRs .)" >> $GITHUB_ENV
- name: Notify Slack
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": "${{ env.message }}",
"text": ${{ env.MESSAGE_JSON }}
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.STRATUS_SLACK_WEBHOOK_URL }}
Expand Down

0 comments on commit 8c00ebf

Please sign in to comment.