@@ -2,6 +2,7 @@ name: Build and Commit Binaries
22
33permissions :
44 contents : write
5+ pull-requests : write
56
67on :
78 workflow_dispatch :
@@ -35,13 +36,11 @@ jobs:
3536 steps :
3637 - name : Checkout code
3738 uses : actions/checkout@v4
38- with :
39- token : ${{ secrets.GITHUB_TOKEN }}
40-
39+
4140 - name : Set up Go
4241 uses : actions/setup-go@v5
4342 with :
44- go-version : ' 1.23' # Use stable version compatible with 1.25.1
43+ go-version : ' 1.23'
4544 cache : true
4645
4746 - name : Run tests
@@ -59,22 +58,17 @@ jobs:
5958 go build -o bin/ragcode-installer ./cmd/install
6059
6160 chmod +x bin/*
62-
63- - name : Check if binaries changed
64- id : check_changes
65- run : |
66- git add -f bin/
67- if git diff --cached --quiet; then
68- echo "changed=false" >> $GITHUB_OUTPUT
69- else
70- echo "changed=true" >> $GITHUB_OUTPUT
71- fi
72-
73- - name : Commit and push binaries
74- if : github.event_name == 'push' && steps.check_changes.outputs.changed == 'true'
75- run : |
76- git config --local user.email "github-actions[bot]@users.noreply.github.com"
77- git config --local user.name "github-actions[bot]"
78- git add -f bin/
79- git commit -m "chore: auto-build binaries [skip ci]"
80- git push
61+
62+ - name : Stage binaries
63+ run : git add -f bin/
64+
65+ - name : Create Pull Request
66+ uses : peter-evans/create-pull-request@v6
67+ with :
68+ token : ${{ secrets.GITHUB_TOKEN }}
69+ commit-message : " chore: update binaries [skip ci]"
70+ title : " chore: update binaries"
71+ body : " Auto-generated PR to update binaries after code changes."
72+ branch : " chore/update-binaries"
73+ base : ${{ github.head_ref || github.ref_name }}
74+ delete-branch : true
0 commit comments