-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (61 loc) · 2.32 KB
/
upstream-watch.yml
File metadata and controls
70 lines (61 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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