Skip to content

Merge pull request #2270 from FabianKramm/main #96

Merge pull request #2270 from FabianKramm/main

Merge pull request #2270 from FabianKramm/main #96

Workflow file for this run

name: Sync Config
on:
push:
branches:
- main
paths:
- "config/**.go"
- "chart/values.schema.json"
- ".github/workflows/sync-config.yaml"
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Configure git
run: git config --global url.https://$GH_ACCESS_TOKEN@github.com/.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: |
git clone --single-branch https://github.com/loft-sh/vcluster-config.git
cp -R config/. vcluster-config/config/
cd vcluster-config
# We have to replace our config dependency so that we do not introduce vcluster as a whole as transitive dependecy.
find ./config/legacyconfig -type f -exec sed -i "s#github.com/loft-sh/vcluster/config#github.com/loft-sh/vcluster-config/config#g" {} +
# Align deps, if there have been any relevant changes in vcluster.
go mod tidy
go mod vendor
# Checkout new branch
git add --all
# 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 'loft-bot@users.noreply.github.com'
echo "Changes detected"
# commit changes
git commit -m "chore: sync vCluster config"
git push -u origin -f main
echo "Pushed commit to main branch"