Skip to content

Merge branch 'main' into dev #44

Merge branch 'main' into dev

Merge branch 'main' into dev #44

name: Ensure correct CMS branch
on:
push:
branches:
- main
- dev
paths:
- src/admin/config.yml # Skip this action unless the Netlify CMS config file has changed.
jobs:
ensure-cms-branch:
runs-on: ubuntu-latest
env:
target_branch: "dev" # Default to dev branch
steps:
- uses: actions/checkout@v2
- name: Adjust target branch for environment
if: endsWith(github.ref, '/main') # If the commit is in
run: |
echo "target_branch=main" >> $GITHUB_ENV
- name: Update CMS branch configuration
uses: mikefarah/[email protected]
with:
cmd: yq eval -i '.backend.branch = "${{ env.target_branch }}"' src/admin/config.yml
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: update CMS branch configuration"
file_pattern: src/admin/config.yml