Ensure merges are properly handled for detection of issues & PRs by RomainCscn · Pull Request #62 · linear/linear-release · GitHub
Skip to content

Ensure merges are properly handled for detection of issues & PRs#62

Merged
RomainCscn merged 3 commits into
mainfrom
romain/lin-69346-github-release-action-misses-issues-merged-into-release
May 11, 2026
Merged

Ensure merges are properly handled for detection of issues & PRs#62
RomainCscn merged 3 commits into
mainfrom
romain/lin-69346-github-release-action-misses-issues-merged-into-release

Conversation

@RomainCscn

Copy link
Copy Markdown
Collaborator

Fix releases missing all issue keys on first sync with merge-commit HEAD

When a release pipeline has no prior release and HEAD is a merge commit (e.g. release-branch workflow merging into main), the action scans only HEAD itself — but the LIN keys live on HEAD^2's incoming history, so nothing gets extracted.

Two layered fixes:

  1. src/index.ts:getLatestSha — when there's no prior release SHA and HEAD is a merge, use HEAD^1 as the scan boundary instead of falling back to currentSha. Range becomes HEAD^1..HEAD, which captures everything brought in via the merge. Non-merge HEAD (squash, direct commit) keeps the conservative HEAD-only behavior.

  2. src/git.ts:getCommitContextsBetweenShas — pass --full-history when includePaths is set, so git stops dropping merge commits as TREESAME within the filtered paths. Also --no-walk for from === to to prevent drift to unrelated ancestors.

@linear-code

linear-code Bot commented May 7, 2026

Copy link
Copy Markdown

@RomainCscn RomainCscn force-pushed the romain/lin-69346-github-release-action-misses-issues-merged-into-release branch from e5555b7 to d6f2afd Compare May 7, 2026 11:54
@RomainCscn RomainCscn merged commit 96ab707 into main May 11, 2026
8 checks passed
@RomainCscn RomainCscn deleted the romain/lin-69346-github-release-action-misses-issues-merged-into-release branch May 11, 2026 08:05
RomainCscn added a commit that referenced this pull request Jun 9, 2026
RomainCscn added a commit that referenced this pull request Jun 9, 2026
* Ensure stale branch are not taken into account by --include-paths

* Address review: drop #62 links and clarify parent-parsing/stale-merge comments
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.

2 participants