Sync Call Assets from eth/pm #982
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/sync-call-assets.yml | |
| name: Sync Call Assets from eth/pm | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' | |
| repository_dispatch: | |
| types: [pm-assets-updated] | |
| workflow_dispatch: | |
| concurrency: | |
| group: sync-main | |
| cancel-in-progress: false | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - name: Checkout forkcast | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Sync assets from eth/pm | |
| id: sync | |
| run: | | |
| node scripts/sync-call-assets.mjs | |
| - name: Extract key decisions from new TLDRs | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| run: node scripts/extract-key-decisions.mjs --all | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet && git diff --cached --quiet && [ -z "$(git ls-files --others --exclude-standard)" ]; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| PATHS="${{ steps.sync.outputs.synced_paths }}" | |
| if [ -n "$PATHS" ]; then | |
| git commit -m "sync call assets from eth/pm" -m "$PATHS" | |
| else | |
| git commit -m "sync call assets from eth/pm" | |
| fi | |
| git push | |
| - name: Trigger deploy | |
| if: steps.changes.outputs.has_changes == 'true' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'deploy.yml', | |
| ref: 'main' | |
| }); |