-
Notifications
You must be signed in to change notification settings - Fork 418
62 lines (62 loc) · 2.47 KB
/
update-a2a-types.yml
File metadata and controls
62 lines (62 loc) · 2.47 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
---
name: Update A2A Schema from Specification
on:
# TODO (https://github.com/a2aproject/a2a-python/issues/559): bring back once types are migrated, currently it generates many broken PRs
# repository_dispatch:
# types: [a2a_json_update]
workflow_dispatch:
jobs:
generate_and_pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- name: Configure uv shell
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies (datamodel-code-generator)
run: uv sync --locked
- name: Define output file variable
id: vars
run: |
GENERATED_FILE="./src/a2a/types.py"
echo "GENERATED_FILE=$GENERATED_FILE" >> "$GITHUB_OUTPUT"
- name: Generate types from schema
run: |
chmod +x scripts/generate_types.sh
./scripts/generate_types.sh "${{ steps.vars.outputs.GENERATED_FILE }}"
- name: Install Buf
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
- name: Run buf generate
run: |
set -euo pipefail # Exit immediately if a command exits with a non-zero status
echo "Running buf generate..."
buf generate
uv run scripts/grpc_gen_post_processor.py
echo "Buf generate finished."
- name: Create Pull Request with Updates
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
token: ${{ secrets.A2A_BOT_PAT }}
committer: a2a-bot <a2a-bot@google.com>
author: a2a-bot <a2a-bot@google.com>
commit-message: '${{ github.event.client_payload.message }}'
title: '${{ github.event.client_payload.message }}'
body: |
Commit: https://github.com/a2aproject/A2A/commit/${{ github.event.client_payload.sha }}
branch: auto-update-a2a-types-${{ github.event.client_payload.sha }}
base: main
labels: |
automated
dependencies
add-paths: |-
${{ steps.vars.outputs.GENERATED_FILE }}
src/a2a/grpc/