From 8d661ef39090d376c08c00fb1ac7f336382209c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Aug 2026 13:54:56 +0000 Subject: [PATCH 1/2] Initial plan From fd2d7a199ff48062e0070bc0c27653d1cd295e28 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Aug 2026 13:58:35 +0000 Subject: [PATCH 2/2] Adjust O2 linter push diff range --- .github/workflows/o2-linter.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index 00c710dbd5a..191d76bddd0 100644 --- a/.github/workflows/o2-linter.yml +++ b/.github/workflows/o2-linter.yml @@ -37,9 +37,19 @@ jobs: - name: Run tests id: linter run: | - # Diff against the common ancestor of the source (head) branch and the target (base) branch. - echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}." - readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...) + if [[ "${{ github.event_name }}" == "push" ]]; then + echo "Diffing ${{ github.event.before }} against ${{ github.sha }}." + if [[ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]]; then + # New branch push: lint files introduced by the pushed commit. + readarray -t files < <(git show --diff-filter d --name-only --pretty=format: ${{ github.sha }}) + else + readarray -t files < <(git diff --diff-filter d --name-only ${{ github.event.before }} ${{ github.sha }}) + fi + else + # Diff against the common ancestor of the source (head) branch and the target (base) branch. + echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}." + readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...) + fi if [ ${#files[@]} -eq 0 ]; then echo "::notice::No files to lint." echo "linter_ran=0" >> "$GITHUB_OUTPUT"