Merge branch 'dev' #63
This file contains 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: 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@v4 | |
- 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@v5 | |
with: | |
commit_message: "chore: update CMS branch configuration" | |
file_pattern: src/admin/config.yml |