Use GH Actions to post EOD activities to slack (#441) #2
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
on: | ||
workflow_call: | ||
inputs: | ||
LEADERBOARD_URL: | ||
type: string | ||
required: true | ||
description: URL to the Leaderboard Deployment (to access the EOD API's) | ||
secrets: | ||
GITHUB_TOKEN: | ||
Check failure on line 10 in .github/workflows/post-activities-updates.yaml GitHub Actions / .github/workflows/post-activities-updates.yamlInvalid workflow file
|
||
required: true | ||
LEADERBOARD_API_KEY: | ||
required: true | ||
SLACK_EOD_BOT_CHANNEL: | ||
required: true | ||
SLACK_EOD_BOT_TOKEN: | ||
required: true | ||
jobs: | ||
main: | ||
name: Fetch activity from GitHub and call Slack Webhook | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 # This pulls the caller workflow's repo (eg: coronasafe/leaderboard-data) | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: coronasafe/leaderboard | ||
path: ./leaderboard | ||
sparse-checkout: activities-bot | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21.x | ||
- run: npm install @octokit/action gray-matter | ||
- run: node scripts/slackEODReminder.js | ||
env: | ||
GITHUB_ORG: ${{ github.repository_owner }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
LEADERBOARD_URL: ${{ inputs.LEADERBOARD_URL }} | ||
LEADERBOARD_API_KEY: ${{ secrets.LEADERBOARD_API_KEY }} | ||
SLACK_EOD_BOT_CHANNEL: ${{ secrets.SLACK_EOD_BOT_CHANNEL }} | ||
SLACK_EOD_BOT_TOKEN: ${{ secrets.SLACK_EOD_BOT_TOKEN }} |