Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/foc-wg-pr-notifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: FOC-WG PR Notifier

on:
schedule:
# Run at 9 AM EST (14:00 UTC) on weekdays
- cron: '0 14 * * 1-5'
workflow_dispatch:
# Allow manual trigger for testing
inputs:
dry_run:
description: 'Dry run (show message without posting to Slack)'
required: false
default: 'false'
type: choice
options:
- 'false'
- 'true'

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run PR Notifier
run: |
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
python foc_wg_pr_notifier.py --dry-run
else
python foc_wg_pr_notifier.py
fi
env:
GITHUB_TOKEN: ${{ secrets.FOC_WG_NOTIFIER_PAT }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,44 @@ Complete workflow for finding relevant Filecoin Slack messages related to specif

This is particularly useful for investigating storage provider issues and tracking community discussions.

### 📢 FOC-WG PR Notifier
**File:** `foc_wg_pr_notifier.py`

Automated daily notification system that fetches open PRs from FilOzone GitHub Project 14 (View 32) and posts a formatted summary to the `#foc-wg` Slack channel.

**Features:**
- Queries GitHub Project 14 via GraphQL API
- Applies View 32 filters (excludes "Done" status, specific milestones)
- Groups PRs by repository
- Posts formatted Slack messages with PR details
- Runs automatically via GitHub Actions (daily at 9 AM EST on weekdays)

**Testing:**

1. **Local dry-run test** (recommended first step):
```bash
GITHUB_TOKEN=your_token python foc_wg_pr_notifier.py --dry-run
```
This will fetch PRs and show the message that would be posted without actually sending to Slack.

2. **Local full test** (posts to Slack):
```bash
GITHUB_TOKEN=your_token SLACK_WEBHOOK_URL=your_webhook python foc_wg_pr_notifier.py
```

3. **GitHub Actions test**:
- Go to the [Actions tab](https://github.com/FilOzone/tpm-utils/actions) in the repository
- Select "FOC-WG PR Notifier" workflow
- Click "Run workflow"
- Choose "true" for dry_run to test without posting, or "false" to post to Slack
- Click "Run workflow" button

**Prerequisites:**
- GitHub PAT with `read:project` organization permission (stored as `FOC_WG_NOTIFIER_PAT` secret)
- Slack incoming webhook URL for `#foc-wg` channel (stored as `SLACK_WEBHOOK_URL` secret)

The workflow runs automatically every weekday at 9 AM EST, but can also be triggered manually for testing.

## Getting Started

1. **Clone the repository**
Expand Down
Loading