Skip to content

Fast fixes

Fast fixes #7

name: notify-new-post
on:
push:
branches: ["main"]
paths: ["src/pages/blog/**/*.mdx"]
permissions:
contents: read
jobs:
notify:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.4
- name: Find newly added blog posts
id: detect
env:
BEFORE_SHA: ${{ github.event.before }}
AFTER_SHA: ${{ github.sha }}
run: |
git diff --name-only --diff-filter=A "$BEFORE_SHA" "$AFTER_SHA" -- 'src/pages/blog/**/*.mdx' > new_posts.txt
if [ ! -s new_posts.txt ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
cat new_posts.txt
- name: Send broadcast(s)
if: steps.detect.outputs.skip != 'true'
env:
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
RESEND_SEGMENT_ID: ${{ secrets.RESEND_SEGMENT_ID }}
run: bun scripts/notify-subscribers.ts