-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sync vendor when go.mod changed. (#2372)
Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
- Loading branch information
1 parent
6fc9618
commit 1504786
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: sync-vendor | ||
|
||
|
||
on: | ||
push: | ||
paths: | ||
- go.mod | ||
|
||
# Remove all permissions from GITHUB_TOKEN except metadata. | ||
permissions: {} | ||
|
||
jobs: | ||
vendor: | ||
name: sync vendor | ||
runs-on: self-runner-kubesphere | ||
if: github.repository == 'kubesphere/kubekey' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Run go mod vendor | ||
run: go mod vendor | ||
|
||
- name: Commit vendor directory | ||
run: | | ||
git config --global user.name 'ks-ci-bot' | ||
git config --global user.email 'ci-bot@kubesphere.io' | ||
git add vendor | ||
git commit -m 'Add vendor directory' | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Add vendor directory | ||
branch: add-vendor-${{ github.event.number }} | ||
title: [ci-bot] Add vendor directory | ||
body: This [PR](https://github.com/kubesphere/kubekey/pull/${{ github.event.number }}) adds the vendor directory generated by go mod vendor. |