From 4a4baddb34a75ace0e8295bc3aabe7b42b01823e Mon Sep 17 00:00:00 2001 From: Bill He Date: Wed, 21 Feb 2024 11:17:00 -0800 Subject: [PATCH] Github action for syncing the release branch --- .github/workflows/update-release.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/update-release.yml diff --git a/.github/workflows/update-release.yml b/.github/workflows/update-release.yml new file mode 100644 index 0000000..8bf77d2 --- /dev/null +++ b/.github/workflows/update-release.yml @@ -0,0 +1,29 @@ +name: Workflow for Release + +on: + release: + types: [created] + +jobs: + sync-release-branch: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Git + run: | + git config user.name "github-actions" + git config user.email "actions@github.com" + + - name: Fetch all history + run: git fetch --unshallow || git fetch --all + + - name: Check out the release branch + run: | + git checkout release || git checkout -b release + + - name: Sync release branch to tag + run: | + git reset --hard ${{ github.ref }} + git push -f origin release