.github/workflows/sync_branches.yml: Add workflow #1
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 Commits to Stable Branch | |
| on: | |
| push: | |
| branches: | |
| - hdmi_frl | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Sync Commits | |
| run: | | |
| COMMITS=$(git log master..${{ github.ref_name }} --pretty=format:"%H" | tac) | |
| if [ -z "$COMMITS" ]; then | |
| echo "No new commits to sync." | |
| exit 0 | |
| fi | |
| git checkout hdmi_frl_stable | |
| for commit in $COMMITS; do | |
| echo "Cherry-picking $commit" | |
| git cherry-pick $commit || (git cherry-pick --abort && echo "Conflict skipped" && exit 1) | |
| done | |
| git push origin hdmi_frl_stable |