chore: sync config/*.go and values.schema.json to vCluster version v0… #49
This file contains hidden or 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
name: Merge Configs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "platform.schema.json" | |
- "values.schema.json" | |
workflow_dispatch: {} | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Configure git | |
run: git config --global url.https://[email protected]/.insteadOf https://github.com/ | |
env: | |
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Clone and update | |
run: | | |
go mod tidy | |
go mod vendor | |
# run tests | |
go test ./hack/pkg -count=1 | |
# merge configs | |
go run ./hack/main.go | |
git add vcluster.schema.json | |
# if there are no changes, exit early | |
if git diff-index --quiet HEAD --; then | |
exit 0 | |
fi | |
# set git info | |
git config --global user.name "Loft Bot" | |
git config --global user.email '[email protected]' | |
echo "Changes detected" | |
# commit changes | |
git commit -m "chore: sync vcluster.schema.json" | |
git push -u origin -f main | |
echo "Pushed commit to main branch" |