Skip to content

VYP: Edited workflow sync file #21

VYP: Edited workflow sync file

VYP: Edited workflow sync file #21

Workflow file for this run

name: Sync to Main
on:
push:
branches:
- 'services/**'
jobs:
sync:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync to main
run: |
SERVICE_PATH="${{ github.ref_name }}"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git checkout main
git pull origin main
git checkout ${{ github.ref_name }} -- .
mkdir -p "$SERVICE_PATH"
cp -r . "$SERVICE_PATH/"
rm -rf "$SERVICE_PATH/.git"
git add "$SERVICE_PATH/"
if ! git diff --staged --quiet; then
git commit -m "Update $SERVICE_PATH"
git push origin main
fi