-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.62 KB
/
Copy pathgraphify-sync.yml
File metadata and controls
79 lines (67 loc) · 2.62 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
71
72
73
74
75
76
77
78
79
name: "DevFlow: Graphify Sync"
# Polls each tracked target repo's default-branch HEAD SHA and incrementally
# updates its Graphify graph whenever the branch has moved (PR merge or push).
# Nothing is installed in target repos — detection is pull-based.
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
jobs:
discover:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.disc.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra storage
- id: disc
env:
GH_PAT: ${{ secrets.GH_PAT }}
GRAPH_STORE_BUCKET: ${{ secrets.GRAPH_STORE_BUCKET }}
GRAPH_STORE_ENDPOINT: ${{ secrets.GRAPH_STORE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: |
matrix=$(uv run python -m tools.graphify_cli discover --mode sync)
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "Changed repos: $matrix"
update:
needs: discover
if: ${{ fromJson(needs.discover.outputs.matrix).include[0] != null }}
strategy:
fail-fast: false
max-parallel: 2
matrix: ${{ fromJson(needs.discover.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
# Shared with graphify-onboard so an onboard and a sync update for the
# same repo never run at once.
group: graphify-${{ matrix.repo }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra storage --extra graphify
- name: "Update graph · ${{ matrix.repo }}"
env:
PYTHONUNBUFFERED: "1"
LLM_MODEL: ${{ vars.GRAPHIFY_MODEL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
GRAPH_STORE_BUCKET: ${{ secrets.GRAPH_STORE_BUCKET }}
GRAPH_STORE_ENDPOINT: ${{ secrets.GRAPH_STORE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: uv run python -m tools.graphify_cli update --repo "${{ matrix.repo }}" --branch "${{ matrix.branch }}"