Skip to content

Merge pull request #2186 from FabianKramm/refactor-ingress-auth #1

Merge pull request #2186 from FabianKramm/refactor-ingress-auth

Merge pull request #2186 from FabianKramm/refactor-ingress-auth #1

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://[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: |
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 '[email protected]'
echo "Changes detected"
# commit changes
git commit -m "chore: sync vCluster config"
git push -u origin -f main
echo "Pushed commit to main branch"