Files
react-native/.github/workflows/monitor-new-issues.yml
Riccardo CipolleschiandFacebook GitHub Bot 890b8f7ea3 Automate the rotation of issue trage squad (#50526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50526

This change wants to automate the rotation of the issue triaging squad on Discord.
This is taking us a few minutes every week to rotate the oncall.

This change can save us some time.

The configuration file format is supposed to be like this:
```
{
  "userMap": {
     "discord-username1": "discord-id1",
     "discord-username2": "discord-id2",
     "discord-username3": "discord-id3",
     "discord-username4": "discord-id4"
   },
  "schedule": {
    "date1": ["discord-username1", "discord-username2"],
    "date2": ["discord-username3", "discord-username4"],
  }
}
```

## Changelog
[Internal] - Automate the issue triage oncall rotation

Reviewed By: cortinico

Differential Revision: D72569435

fbshipit-source-id: 435c13350cf503e99302775674e78a20e328e68d
2025-04-08 02:43:44 -07:00

47 lines
1.6 KiB
YAML

name: Monitor React Native New Issues
on:
schedule:
- cron: "0 0,6,12,18 * * *"
workflow_dispatch:
# Reminder for when we have to update the schedule (before Jan 2026):
# the secrets.ONCALL_SCHEDULE secret must be on a single line and must have all the `"` escaped as `\"`.
# Only a meta engineer can update it through the OSS internal portal.
jobs:
monitor-issues:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Extract next oncall
run: |
ONCALLS=$(node ./.github/workflow-scripts/extractIssueOncalls.js "${{ secrets.ONCALL_SCHEDULE }}")
ONCALL1=$(echo $ONCALLS | cut -d ' ' -f 1)
ONCALL2=$(echo $ONCALLS | cut -d ' ' -f 2)
echo "oncall1=$ONCALL1" >> $GITHUB_ENV
echo "oncall2=$ONCALL2" >> $GITHUB_ENV
- name: Print oncalls
run: |
echo "oncall1: ${{ env.oncall1 }}"
echo "oncall2: ${{ env.oncall2 }}"
- name: Monitor New Issues
uses: react-native-community/repo-monitor@v1.0.1
with:
task: "monitor-issues"
git_secret: ${{ secrets.GITHUB_TOKEN }}
notifier: "discord"
fetch_data_interval: 6
repo_owner: "facebook"
repo_name: "react-native"
discord_webhook_url: "${{ secrets.DISCORD_WEBHOOK_URL }}"
discord_id_type: "user"
discord_ids: "${{ env.oncall1 }},${{ env.oncall2 }}"