[PR #160] [MERGED] In GitHub CI: Fetch deleted commits using GitHub PR refs #301

Closed
opened 2026-03-02 04:13:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/git-ai-project/git-ai/pull/160
Author: @mm-zacharydavison
Created: 10/28/2025
Status: Merged
Merged: 10/28/2025
Merged by: @svarlamov

Base: mainHead: zachary/fetch-deleted-commits-in-github-ci


📝 Commits (1)

  • 968c642 In GitHub CI: Fetch deleted commits using GitHub PR refs

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 src/ci/github.rs (+13 -0)

📄 Description

After a merge, the HEAD_SHA commit of the pull request will be deleted by GitHub, which will cause GitHub CI workflow to fail:

e.g:

Rewriting authorship for ddda1db567058678abd253df6b96f9c57d9018f8 -> 688eb8980aa402b60da3388517c85814695e877b (squash or rebase-like merge)
Fetching base branch master
Fetched base branch. Fetching authorship history
Fetched authorship history
Error running GitHub CI context: Git CLI (-C git-ai-ci-clone --no-pager cat-file -t ddda1db567058678abd253df6b96f9c57d9018f8) failed with exit code 128: fatal: git cat-file: could not get object info

This PR explicitly pulls the commits from GitHub using their pull/{n}/head refs, which are kept alive.

I'm not sure of the best way to add tests for this, either need to mock GitHubs pull request refs, or use integration tests.
Let me know which you prefer.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/git-ai-project/git-ai/pull/160 **Author:** [@mm-zacharydavison](https://github.com/mm-zacharydavison) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@svarlamov](https://github.com/svarlamov) **Base:** `main` ← **Head:** `zachary/fetch-deleted-commits-in-github-ci` --- ### 📝 Commits (1) - [`968c642`](https://github.com/git-ai-project/git-ai/commit/968c64296d24cb4caa09b272ac171be3efc5df7f) In GitHub CI: Fetch deleted commits using GitHub PR refs ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/ci/github.rs` (+13 -0) </details> ### 📄 Description After a merge, the HEAD_SHA commit of the pull request will be deleted by GitHub, which will cause GitHub CI workflow to fail: e.g: ``` Rewriting authorship for ddda1db567058678abd253df6b96f9c57d9018f8 -> 688eb8980aa402b60da3388517c85814695e877b (squash or rebase-like merge) Fetching base branch master Fetched base branch. Fetching authorship history Fetched authorship history Error running GitHub CI context: Git CLI (-C git-ai-ci-clone --no-pager cat-file -t ddda1db567058678abd253df6b96f9c57d9018f8) failed with exit code 128: fatal: git cat-file: could not get object info ``` This PR explicitly pulls the commits from GitHub using their `pull/{n}/head` refs, which are kept alive. I'm not sure of the best way to add tests for this, either need to mock GitHubs pull request refs, or use integration tests. Let me know which you prefer. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:13:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#301
No description provided.