added new 4 #121
This file contains hidden or 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: Sync Demo Branch | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync-demo-branch: | |
runs-on: ubuntu-latest | |
steps: | |
# *** CHANGE HERE: Revert to v3 for testing *** | |
- name: Checkout demo branch | |
uses: actions/checkout@v3 # Reverted for testing | |
with: | |
ref: 'demo' | |
token: ${{ secrets.DEMO_UPDATE_PAT }} | |
fetch-depth: 0 # Still needed | |
# Verify .gitattributes | |
- name: Verify .gitattributes | |
run: | | |
echo "Checking .gitattributes content:" | |
cat .gitattributes || echo ".gitattributes not found!" | |
# Configure Git user for the commit | |
- name: Configure Git User | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "actions-bot@github.com" | |
# Disable autocrlf (keep this for now, doesn't hurt) | |
- name: Disable autocrlf | |
run: git config --global core.autocrlf false | |
# Fetch the latest changes from the remote, including main | |
- name: Fetch origin | |
run: git fetch origin | |
# Perform the merge from main into demo (Relying on .gitattributes) | |
- name: Merge main into demo (using .gitattributes) | |
run: | | |
# Relying on .gitattributes to handle demo-specific folders | |
git merge --no-ff origin/main -m "Auto-merge main into demo" | |
# Push the merge commit (and resolved changes) back to the demo branch | |
- name: Push changes to demo | |
run: | | |
git push origin demo |