Skip to content

Update Burner Email Domains #39

Update Burner Email Domains

Update Burner Email Domains #39

name: Update Burner Email Domains
on:
schedule:
# Run daily at 6 AM UTC
- cron: '0 6 * * *'
workflow_dispatch: # Allow manual trigger
concurrency:
group: update-burner-domains
cancel-in-progress: false
permissions:
contents: write
issues: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache Puppeteer browser
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer
key: puppeteer-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
puppeteer-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run domain scraper
id: scraper
run: node scripts/scrape-domains.cjs
- name: Check for changes
id: changes
run: |
git diff --quiet src/data/discovered-domains.json || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add src/data/discovered-domains.json
git commit -m "chore: update burner email domains [skip ci]
Total domains: ${{ steps.scraper.outputs.total_domains }}
New domains: ${{ steps.scraper.outputs.new_domains }}"
git push
- name: Create issue on failure
if: failure()
uses: actions/github-script@v7
env:
ERROR_LIST: ${{ steps.scraper.outputs.error_list }}
with:
script: |
const title = 'Burner Domain Updater Failed';
const errorList = process.env.ERROR_LIST || 'Unknown error';
const body = `The daily burner email domain updater failed.
**Run:** ${context.runId}
**Errors:** ${errorList}
Please check the [workflow run](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.`;
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'updater-failure'
});
if (issues.data.length === 0) {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body,
labels: ['updater-failure', 'automated']
});
}