Skip to content

scheduled-test-stats #12

scheduled-test-stats

scheduled-test-stats #12

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
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
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_TEAM }}
payload: |
{
"text": "Team Node.js Test Stats",
"attachments": [{
"color": "good",
"fields": [
{
"title": "Number of Test Cases [for Node.js repository](https://github.com/instana/nodejs)",
"value": "${{ env.instana_stats_test_cases }}"
}
]
}]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}