From 780a89308045ce595e94aec3c0aa6e23b08a9822 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 8 Jan 2024 23:56:56 +0100 Subject: [PATCH] .github/workflows: Fix each commit CI job By fetching the full history and checking out the HEAD commit of the branch we fix it and using the action parameters is also less code. Broken since its introduction in c3e7dc3a (.github/workflows: Add job to compile test each commit, 2023-12-22). In addition we also need to pass --quit to git rebase as --abort resets HEAD which we don't want. Close #1968 --- .github/workflows/test-igor-rebase-exec-workflow.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-igor-rebase-exec-workflow.yml b/.github/workflows/test-igor-rebase-exec-workflow.yml index 1b890bfa37..b0c3b996e0 100644 --- a/.github/workflows/test-igor-rebase-exec-workflow.yml +++ b/.github/workflows/test-igor-rebase-exec-workflow.yml @@ -74,18 +74,14 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - name: Initial repo config run: tools/initial-repo-config.sh - - name: Fetch latest changes for main - run: git fetch origin main - - name: Fetch latest changes of branch - run: git fetch origin $GITHUB_HEAD_REF - - name: Checking out branch - run: git checkout -B $GITHUB_HEAD_REF origin/$GITHUB_HEAD_REF - name: List of commits to operate on run: git log --pretty=ref origin/main.. - name: Cleanup earlier rebase invocations - run: git rebase --abort 2>/dev/null || true + run: git rebase --quit 2>/dev/null || true - name: Compile check each commit with ${{ inputs.experiment }} run: | git rebase --exec "git log --pretty=ref -n1" \