@@ -2,12 +2,15 @@ name: Update A2A Schema from Specification
22
33on :
44 schedule :
5- - cron : " 0 0 * * *"
5+ - cron : " 0 0 * * *" # Runs daily at 00:00 UTC
66 workflow_dispatch :
77
88jobs :
99 check_and_update :
1010 runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ pull-requests : write
1114
1215 steps :
1316 - name : Checkout code
@@ -58,29 +61,22 @@ jobs:
5861 --use-standard-collections
5962 echo "Codegen finished."
6063
61- - name : Commit and push if generated file changed
62- if : github.ref == 'refs/heads/main' # Or your default branch name
63- run : |
64- set -euo pipefail
65-
66- GENERATED_FILE="${{ steps.vars.outputs.GENERATED_FILE }}"
67-
68- # Check if the generated file has any changes compared to HEAD
69- if git diff --quiet "$GENERATED_FILE"; then
70- echo "$GENERATED_FILE has no changes after codegen. Nothing to commit."
71- else
72- echo "Changes detected in $GENERATED_FILE. Committing..."
73- # Configure git user for the commit
74- git config user.name "a2a-bot"
75- git config user.email "[email protected] " 76-
77- # Add the generated file
78- git add "$GENERATED_FILE"
79-
80- # Commit changes
81- git commit -m "🤖 chore: Auto-update A2A schema from specification"
82-
83- # Push changes
84- git push
85- echo "Changes committed and pushed."
86- fi
64+ - name : Create Pull Request if generated file changed
65+ uses : peter-evans/create-pull-request@v6
66+ with :
67+ token : ${{ secrets.GITHUB_TOKEN }}
68+ committer :
a2a-bot <[email protected] > 69+ author :
a2a-bot <[email protected] > 70+ commit-message : " chore: 🤖 Auto-update A2A schema from specification"
71+ title : " chore: 🤖 Auto-update A2A Schema from Specification"
72+ body : |
73+ This PR automatically updates the A2A schema types based on the latest specification.
74+
75+ This update was triggered by the scheduled workflow run.
76+ See the workflow run details: [${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
77+ branch : " a2a-schema-update"
78+ base : main
79+ labels : |
80+ automated
81+ dependencies
82+ add-paths : ${{ steps.vars.outputs.GENERATED_FILE }}
0 commit comments