Skip to content

Fix fatal checkout error in linter workflow by removing ready_for_review trigger - #9

Merged
VimukthiPerera merged 2 commits into
mainfrom
copilot/update-linter-workflow
Mar 3, 2026
Merged

Fix fatal checkout error in linter workflow by removing ready_for_review trigger#9
VimukthiPerera merged 2 commits into
mainfrom
copilot/update-linter-workflow

Conversation

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

The linter workflow was failing with fatal: bad object during the super-linter step when triggered by the ready_for_review pull_request event. Draft-to-ready conversions can fire before commit refs are consistently available on the runner, causing the SHA-based checkout/diff to fail.

Goals

  • Restrict pull_request trigger to [opened, synchronize, reopened], eliminating the unreliable ready_for_review trigger path.
  • Preserve existing SHA-pinned checkout (ref: github.event.pull_request.head.sha, fetch-depth: 0) and base-branch fetch logic.

Approach

Single-line change in .github/workflows/linter.yml:

# Before
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

# After
on:
  pull_request:
    types: [opened, synchronize, reopened]

The pull_request_review trigger (approved reviews only) and all downstream steps are unchanged.

User stories

N/A — internal CI reliability fix.

Release note

N/A — workflow-only change with no product impact.

Documentation

N/A — no user-facing documentation affected.

Training

N/A

Certification

N/A — no feature or behavioral change.

Marketing

N/A

Automation tests

  • Unit tests: N/A
  • Integration tests: N/A — validated by the linter workflow itself running cleanly on this PR.

Security checks

Samples

N/A

Related PRs

N/A

Migrations (if applicable)

N/A

Test environment

GitHub Actions / ubuntu-latest

Learning

N/A

Original prompt

Update .github/workflows/linter.yml to fix the fatal checkout error and make the workflow more robust.

Required changes:

  • Update the on: section to also trigger on pull_request with types: [opened, synchronize, reopened] in addition to pull_request_review.
  • Ensure the code checkout and fetch steps remain, preserving the set SHA logic and full history (fetch-depth: 0).

This will address the fatal: bad object error caused by missing commit references during the linter job.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@VimukthiPerera VimukthiPerera changed the title [WIP] Update linter workflow to fix fatal checkout error Update linter workflow to fix fatal checkout error Mar 3, 2026
@VimukthiPerera
VimukthiPerera marked this pull request as ready for review March 3, 2026 07:29
Copilot AI review requested due to automatic review settings March 3, 2026 07:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: VimukthiPerera <15902071+VimukthiPerera@users.noreply.github.com>
Copilot AI changed the title Update linter workflow to fix fatal checkout error Fix fatal checkout error in linter workflow by removing ready_for_review trigger Mar 3, 2026
@VimukthiPerera
VimukthiPerera merged commit 54dd6d1 into main Mar 3, 2026
0 of 4 checks passed
@HiranAdikari
HiranAdikari deleted the copilot/update-linter-workflow branch May 30, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants