Skip to content

Commit

Permalink
fix(l1, l2, levm): loc reporter (#1274)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomás Arjovsky <[email protected]>
  • Loading branch information
ilitteri and Arkenan authored Nov 26, 2024
1 parent ffc1f7c commit a11d8db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/loc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,15 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Generate the loc report
id: loc-report
run: |
make loc
echo "content=$(cat loc_report.md)" >> $GITHUB_OUTPUT
- name: Post results in summary
run: |
echo "# `ethrex` lines of code report:\n\n" >> $GITHUB_STEP_SUMMARY
$(cat loc_report.md) >> $GITHUB_STEP_SUMMARY
echo "# `ethrex` lines of code report" >> $GITHUB_STEP_SUMMARY
cat loc_report.md >> $GITHUB_STEP_SUMMARY
- name: Post results to slack
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
blocks:
- type: "header"
text:
type: "plain_text"
text: ethrex lines of code report
- type: "section"
text:
type: "mrkdwn"
text: ${{steps.loc-report.outputs.content}}
env:
url: ${{ secrets.SLACK_WEBHOOK_URL }}
run: sh publish_loc.sh
22 changes: 22 additions & 0 deletions publish_loc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
curl -X POST $url \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat loc_report.md)" '{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Weekly ethrex lines of code report"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": $text
}
}
]
}')
EOF

0 comments on commit a11d8db

Please sign in to comment.