From e6d79215e71307ca89676ffb9fe1dc6dc3a25e9c Mon Sep 17 00:00:00 2001 From: libm Date: Fri, 28 Feb 2025 21:19:31 +0800 Subject: [PATCH] add rebase action --- .github/workflows/auto-rebase.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/auto-rebase.yml diff --git a/.github/workflows/auto-rebase.yml b/.github/workflows/auto-rebase.yml new file mode 100644 index 0000000..b8f827d --- /dev/null +++ b/.github/workflows/auto-rebase.yml @@ -0,0 +1,29 @@ +name: Rebase arch branches to mater + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Rebase and push + run: | + for branch in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin/arch*); do + git checkout ${branch#origin/} + git rebase master + git push --force + done \ No newline at end of file