diff --git a/.github/workflows/zig_update.yaml b/.github/workflows/zig_update.yaml index b0b81202..ed12c378 100644 --- a/.github/workflows/zig_update.yaml +++ b/.github/workflows/zig_update.yaml @@ -19,6 +19,8 @@ jobs: bazel run //util:update_zig_versions [ -z "$(git status --porcelain=v1 zig/private/versions.bzl 2>/dev/null)" ] || { NEW_VERSION="$(grep -m 1 -oP '^\s+"\K\d+\.\d+\.\d+(?=":)' zig/private/versions.bzl)" + BRANCH="zig-update-$NEW_VERSION" + git switch -c "$BRANCH" git add zig/private/versions.bzl readarray -t FILES < <(git grep -l -F "$OLD_VERSION" -- ':(exclude)zig/private/versions.bzl') sed -i "s/${OLD_VERSION//./\\.}/$NEW_VERSION/g" "${FILES[@]}" @@ -26,6 +28,7 @@ jobs: git config user.name "GitHub" git config user.email "noreply@github.com" git commit -m 'update Zig versions' + git push -u origin "$BRANCH" gh pr create \ --title "chore: update Zig versions up to $NEW_VERSION" \ --body "- [ ] Check that the automatic version replacements make sense."