Skip to content

Commit 1be4424

Browse files
committed
Update to commit changes to current PR when running on a PR
1 parent 9793fc6 commit 1be4424

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/update-a2a-types.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
steps:
2525
- name: Checkout code
2626
uses: actions/checkout@v4
27+
with:
28+
ref: ${{ github.event.pull_request.head.ref }}
29+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2730

2831
- name: Set up Python
2932
uses: actions/setup-python@v5
@@ -62,7 +65,18 @@ jobs:
6265
uv run scripts/grpc_gen_post_processor.py
6366
echo "Buf generate finished."
6467
65-
- name: Create Pull Request with Updates
68+
- name: Commit changes to current PR
69+
if: github.event_name == 'pull_request' # Only run this step for pull_request events
70+
run: |
71+
git config user.name "a2a-bot"
72+
git config user.email "a2a-bot@google.com"
73+
git add ${{ steps.vars.outputs.GENERATED_FILE }} src/a2a/grpc/
74+
git diff --cached --exit-code || git commit -m "feat: Update A2A types from specification 🤖"
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.A2A_BOT_PAT }}
77+
78+
- name: Create Pull Request with Updates (for repository_dispatch/workflow_dispatch)
79+
if: github.event_name != 'pull_request'
6680
uses: peter-evans/create-pull-request@v6
6781
with:
6882
token: ${{ secrets.A2A_BOT_PAT }}

0 commit comments

Comments
 (0)