Upstream watch #3
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
| name: Upstream watch | |
| # Polls upstream projects this plugin depends on (ACP spec + the five CLIs) | |
| # once a week. When any of them ship a new release, opens an issue assigned to | |
| # the Copilot Coding Agent (`copilot-swe-agent`) so Copilot can research and | |
| # propose plugin updates. | |
| # | |
| # Manual trigger via the Actions tab is also supported (workflow_dispatch). | |
| on: | |
| schedule: | |
| # Mondays at 14:00 UTC (~10am Eastern, ~7am Pacific). Weekly is enough — | |
| # upstream changes don't ship on hourly cadence and we'd rather under-fire | |
| # than spam the Copilot agent. | |
| - cron: "0 14 * * 1" | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write # to commit .github/upstream-state.json updates | |
| issues: write # to open the upstream-changes issue | |
| pull-requests: write # so the Copilot agent has the scope it needs once assigned | |
| concurrency: | |
| # If the cron and a manual run collide, let the manual run win. | |
| group: upstream-watch | |
| cancel-in-progress: false | |
| jobs: | |
| watch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Node | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "20" | |
| - name: Poll upstream sources | |
| id: poll | |
| env: | |
| # Auth the GitHub API call — avoids the 60/hr unauthenticated limit. | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node .github/scripts/upstream-watch.mjs | |
| - name: Commit updated state file | |
| if: always() | |
| run: | | |
| if git diff --quiet -- .github/upstream-state.json; then | |
| echo "No state changes to commit." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add .github/upstream-state.json | |
| git commit -m "chore(upstream-watch): bump state $(date -u +%Y-%m-%d)" | |
| git push | |
| - name: Open issue for Copilot | |
| if: steps.poll.outputs.has_changes == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ISSUE_TITLE: ${{ steps.poll.outputs.issue_title }} | |
| run: | | |
| gh issue create \ | |
| --title "$ISSUE_TITLE" \ | |
| --body-file upstream-issue-body.md \ | |
| --assignee copilot-swe-agent \ | |
| --label upstream-watch |