diff --git a/.github/update.sh b/.github/update.sh index ae7aaf4..e474ee1 100755 --- a/.github/update.sh +++ b/.github/update.sh @@ -138,6 +138,7 @@ commit_beta_targets="" commit_beta_version="" commit_twilight_targets="" commit_twilight_version="" +beta_updated=false update_version() { # twilight or beta @@ -260,6 +261,7 @@ update_version() { fi if [ "$version_name" = "beta" ]; then + beta_updated=true if [ "$commit_beta_targets" = "" ]; then commit_beta_targets="$arch" commit_beta_version="$semver" @@ -322,6 +324,7 @@ main() { fi echo "commit_message=$message" >>"$GITHUB_OUTPUT" + echo "should_rebase_beta=$beta_updated" >>"$GITHUB_OUTPUT" fi } diff --git a/.github/workflows/zen-update.yml b/.github/workflows/zen-update.yml index ffdf5fe..efd6141 100644 --- a/.github/workflows/zen-update.yml +++ b/.github/workflows/zen-update.yml @@ -50,6 +50,7 @@ jobs: file_pattern: "*" outputs: success: ${{ steps.update.outputs.should_update }} + should_rebase_beta: ${{ steps.update.outputs.should_rebase_beta }} test-build: if: needs.update-zen-browser.outputs.success == 'true' @@ -74,3 +75,27 @@ jobs: for package in $(nix flake show --json 2>/dev/null | jq -r '.packages.["x86_64-linux"] | keys | .[]'); do nix build --system 'x86_64-linux' ".#$package" done + + rebase-beta: + if: needs.update-zen-browser.outputs.should_rebase_beta == 'true' + name: Rebase beta branch from main + runs-on: ubuntu-latest + needs: update-zen-browser + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Rebase beta branch from main + run: | + git checkout beta + git rebase main + git push origin beta --force-with-lease