ci(zen-update): rebase beta branch from main when needed (#85)

Related to https://github.com/0xc000022070/zen-browser-flake/issues/84.
This commit is contained in:
Luis Quiñones
2025-08-15 10:10:14 -05:00
committed by GitHub
parent 8bf64e38ba
commit 3693c02790
2 changed files with 28 additions and 0 deletions

3
.github/update.sh vendored
View File

@@ -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
}

View File

@@ -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