Skip to content

Commit

Permalink
build(ci): preserve rust version when merging (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrod-starkware authored Aug 27, 2024
1 parent 87d874f commit 19d3a75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/actions/install_rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Installs rust toolchain. In order to set/fix the version, edit DEFAULT_TOOLCHAIN env variable.
# Installs rust toolchain with the version defined in .github/actions/install_rust/rust_version.txt.
inputs:
components:
description: "An optional parameter that will be sent to dtolnay/rust-toolchain."
Expand All @@ -9,7 +9,7 @@ runs:
using: "composite"
steps:
- name: Define toolchain
run: echo "DEFAULT_TOOLCHAIN=stable" >> $GITHUB_ENV
run: echo "DEFAULT_TOOLCHAIN=$(cat .github/actions/install_rust/rust_version.txt)" >> $GITHUB_ENV
shell: bash
- name: install rust toolchain with given components
if: "${{ inputs.components != '' }}"
Expand Down
1 change: 1 addition & 0 deletions .github/actions/install_rust/rust_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
3 changes: 3 additions & 0 deletions scripts/merge_branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

FINAL_BRANCH = "main"
MERGE_PATHS_FILE = "scripts/merge_paths.json"
FILES_TO_PRESERVE = {".github/actions/install_rust/rust_version.txt"}


def load_merge_paths() -> Dict[str, str]:
Expand Down Expand Up @@ -114,6 +115,8 @@ def merge_branches(src_branch: str, dst_branch: Optional[str]):

run_command(f"git merge origin/{src_branch}", allow_error=True)

run_command(f"git checkout origin/{dst_branch} {' '.join(FILES_TO_PRESERVE) }")

run_command("git config --unset merge.conflictstyle")
run_command("git status -s | grep \"^UU\" | awk '{ print $2 }' | tee /tmp/conflicts")

Expand Down

0 comments on commit 19d3a75

Please sign in to comment.