scheduled-test-stats #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: scheduled-test-stats | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # Every Monday at 06:00 AM UTC | |
workflow_dispatch: | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Execute stats | |
id: step_one | |
run: | | |
stats_cases=$(node bin/gather-test-stats.js) | |
echo $stats_cases | |
echo "instana_stats_test_cases=$stats_cases" >> $GITHUB_ENV | |
- name: Send slack message | |
id: step_two | |
uses: slackapi/[email protected] | |
with: | |
channel-id: ${{ secrets.SLACK_CHANNEL_ID_TEAM }} | |
payload: | | |
{ | |
"text": "Team Node.js Test Stats", | |
"attachments": [{ | |
"color": "good", | |
"fields": [ | |
{ | |
"title": "Number of Test Cases in https://github.com/instana/nodejs:", | |
"value": "$instana_stats_test_cases" | |
} | |
] | |
}] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |