| 1 | name: Sync Release Branch |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: |
| 6 | - created |
| 7 | |
| 8 | jobs: |
| 9 | sync-release-branch: |
| 10 | runs-on: ubuntu-latest |
| 11 | if: startsWith(github.event.release.tag_name, 'v1') |
| 12 | steps: |
| 13 | - name: Check out the repo |
| 14 | uses: actions/checkout@v4 |
| 15 | with: |
| 16 | fetch-depth: 0 |
| 17 | ref: v1 |
| 18 | |
| 19 | # The email is derived from the bots user id, |
| 20 | # found here: https://api.github.com/users/github-actions%5Bbot%5D |
| 21 | - name: Configure Git |
| 22 | run: | |
| 23 | git config user.name github-actions[bot] |
| 24 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com |
| 25 | |
| 26 | - name: Sync Release Branch |
| 27 | run: | |
| 28 | git fetch --tags |
| 29 | git checkout v1 |
| 30 | git reset --hard ${GITHUB_REF} |
| 31 | git push --force |