From 4078a127875a185b11c046c7c8b301e50c3f451e Mon Sep 17 00:00:00 2001 From: Matej Almasi <¨almasi.mato@gmail.com¨> Date: Mon, 9 Dec 2024 22:12:40 +0100 Subject: [PATCH 1/4] Add push event trigger and merge simulation for PR workflow --- .github/workflows/pr-main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index 9cc4a45..e64e714 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - main + push: + branches: + - main env: CARGO_TERM_COLOR: always @@ -33,6 +36,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Merge PR branch into main + if: ${{ github.event_name == 'pull_request'}} + run: | + git fetch origin ${{ github.event.pull_request.head.ref }} + git merge FETCH_HEAD -m "CI Merge Simulation" + - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 From 66fc6abdf1d554b16237fafa86d5528c27c00d1c Mon Sep 17 00:00:00 2001 From: Matej Almasi <¨almasi.mato@gmail.com¨> Date: Mon, 9 Dec 2024 22:17:40 +0100 Subject: [PATCH 2/4] simplify merge of main in pr-main.yaml --- .github/workflows/pr-main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index e64e714..7f1ec68 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -39,8 +39,7 @@ jobs: - name: Merge PR branch into main if: ${{ github.event_name == 'pull_request'}} run: | - git fetch origin ${{ github.event.pull_request.head.ref }} - git merge FETCH_HEAD -m "CI Merge Simulation" + git merge main - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 From deff8796d020ed254d34e53a9f5d47bfe64e283f Mon Sep 17 00:00:00 2001 From: Matej Almasi <¨almasi.mato@gmail.com¨> Date: Mon, 9 Dec 2024 22:19:12 +0100 Subject: [PATCH 3/4] amend: commit unstaged update --- .github/workflows/pr-main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index 7f1ec68..7a31e23 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -39,7 +39,8 @@ jobs: - name: Merge PR branch into main if: ${{ github.event_name == 'pull_request'}} run: | - git merge main + git switch main + git merge ${{ github.event.pull_request.head.ref }} - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 From 1c699b753b081b996f0e1346aad3b48576396e71 Mon Sep 17 00:00:00 2001 From: Matej Almasi <¨almasi.mato@gmail.com¨> Date: Mon, 9 Dec 2024 22:22:21 +0100 Subject: [PATCH 4/4] remove merging of main into PR ref in CI --- .github/workflows/pr-main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index 7a31e23..e56c1b9 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -36,12 +36,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Merge PR branch into main - if: ${{ github.event_name == 'pull_request'}} - run: | - git switch main - git merge ${{ github.event.pull_request.head.ref }} - - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1