File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : API Sync
2+
3+ on :
4+ repository_dispatch :
5+ types : [api-sync]
6+ workflow_dispatch : # allow manual triggering
7+
8+ # Add explicit permissions
9+ permissions :
10+ contents : write
11+ pull-requests : write
12+
13+ jobs :
14+ sync :
15+ name : Sync API Types
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - uses : actions/setup-go@v5
21+ with :
22+ go-version-file : go.mod
23+ cache : true
24+
25+ - name : Run codegen
26+ run : go generate
27+
28+ - name : Check for changes
29+ id : check
30+ run : |
31+ if git diff --ignore-space-at-eol --exit-code --quiet pkg; then
32+ echo "No changes detected"
33+ echo "has_changes=false" >> $GITHUB_OUTPUT
34+ else
35+ echo "Changes detected"
36+ echo "has_changes=true" >> $GITHUB_OUTPUT
37+ fi
38+
39+ - name : Create Pull Request
40+ if : steps.check.outputs.has_changes == 'true'
41+ uses : peter-evans/create-pull-request@v5
42+ with :
43+ commit-message : " chore: sync API types from infrastructure"
44+ title : " chore: sync API types from infrastructure"
45+ body : |
46+ This PR was automatically created to sync API types from the infrastructure repository.
47+
48+ Changes were detected in the generated API code after syncing with the latest spec from infrastructure.
49+ branch : sync/api-types
50+ base : develop
51+ labels : |
52+ automated pr
53+ api-sync
You can’t perform that action at this time.
0 commit comments