Skip to content

Scope O2 linter push runs to pushed commit range - #1

Closed
annetkonings with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-o2-linter-job
Closed

Scope O2 linter push runs to pushed commit range#1
annetkonings with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-o2-linter-job

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown

The O2 linter workflow was failing on push because it linted the full branch divergence from master, surfacing unrelated pre-existing violations. This change narrows push-time linting to files introduced by the pushed commit range while keeping PR behavior unchanged.

  • Workflow diff scope

    • On push, file selection now uses ${{ github.event.before }}..${{ github.sha }} instead of origin/${{ env.BRANCH_BASE }}....
    • On first push to a new branch (before is all-zero SHA), file selection falls back to files in ${{ github.sha }}.
  • Event-specific behavior preserved

    • pull_request_target path is unchanged and still diffs against the base branch via merge-base semantics.
  • Updated run logic (excerpt)

if [[ "${{ github.event_name }}" == "push" ]]; then
  if [[ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]]; then
    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
  readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...)
fi

Copilot AI changed the title [WIP] Fix failing GitHub Actions job O2 linter Scope O2 linter push runs to pushed commit range Aug 3, 2026
Copilot AI requested a review from annetkonings August 3, 2026 14:01
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.

@github-actions github-actions Bot added the stale label Sep 3, 2026
@github-actions github-actions Bot closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants