Skip to content

Incremental GitHub -> Postgres Sync #65

Incremental GitHub -> Postgres Sync

Incremental GitHub -> Postgres Sync #65

Workflow file for this run

name: Incremental GitHub -> Postgres Sync
on:
schedule:
# Run every hour during my typical working hours M-F in UTC
- cron: '0 16-23 * * 1-5'
workflow_dispatch: # Allow manual triggering
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
org:
- bazel-contrib
- aspect-build
- aspect-extensions
- chainguard-dev
- bazelbuild
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
INSTALLATION_ID: ${{ secrets.INSTALLATION_ID }}
GITHUB_ORG: ${{ matrix.org }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run:syncIncremental
- run: pnpm run:syncIssueReactions
- name: Notify on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Sync failed: ${context.workflow} run #${context.runNumber}`,
body: `The incremental sync workflow failed. Check the [workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.`
});