Skip to content

Commit

Permalink
Mirror the main branch to the release branch (#11)
Browse files Browse the repository at this point in the history
The branch name is taken from the last upstream commit in the `main`
branch.
  • Loading branch information
mrobinson authored Mar 6, 2024
1 parent a8b69ff commit 3f129fb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/mirror-to-release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🪞 Mirror `main`
on:
push:
branches:
- main

jobs:
mirror:
name: Mirror
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get branch name
id: branch-name
run: |
first_commit=$(git log --pretty=\%H --grep='Servo initial downstream commit')
upstream_base="$first_commit~"
echo BRANCH_NAME=$(git log -n1 --pretty='%as' $upstream_base) >> $GITHUB_OUTPUT
- uses: google/[email protected]
name: Mirror to ${{ steps.branch-name.outputs.BRANCH_NAME }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
source: main
dest: ${{ steps.branch-name.outputs.BRANCH_NAME }}

0 comments on commit 3f129fb

Please sign in to comment.