OSS Activity Slack Bot #7
This file contains hidden or 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
# ----------------------------------------------------------------------------- | |
# Posts biweekly open-source activity metrics to internal Slack channel | |
# Triggers: bi-weekly schedule and manual dispatch | |
# Job: runs './scripts/github-actions/slackReport.js' script | |
# ----------------------------------------------------------------------------- | |
name: OSS Activity Slack Bot | |
on: | |
workflow_dispatch: # enables manual trigger | |
schedule: | |
- cron: '0 0 1,15 * *' # Runs at 00:00 on the 1st and 15th of every month | |
jobs: | |
gather-gh-activity: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
pull-requests: read | |
issues: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 # https://github.com/actions/checkout | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 # https://github.com/actions/setup-node | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
npm install @octokit/rest @slack/web-api --force | |
- name: Gather contributor activity | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | |
run: | | |
node ./scripts/github-actions/slackReport.js |