fix: Use current branch for GitHub API when no range is specified#1275
fix: Use current branch for GitHub API when no range is specified#1275joluizquierdo wants to merge 1 commit intoorhun:mainfrom
Conversation
When running git-cliff --unreleased without a specific range, it now uses the current branch name for GitHub API calls instead of defaulting to the repository's default branch. This ensures that unreleased commits on feature/develop branches are properly matched with their corresponding pull requests. Fixes issue where GitHub metadata (PR numbers, titles) was not populated for unreleased commits on non-default branches. Also fixed .gitignore to ignore target/ insteand of /target
|
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1275 +/- ##
==========================================
+ Coverage 43.46% 43.62% +0.16%
==========================================
Files 22 22
Lines 1972 1981 +9
==========================================
+ Hits 857 864 +7
- Misses 1115 1117 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hello, like I remarked in the issue that I opened today, I have no prior expirience with rust, I'm more familiar with nodejs, python and other languages, I do know how to write code. Therefore, with some help of the AI, I was able to locate the fix and propose a extreamly clumpsy suggestion. I hope to at least point the error and save you time! |
orhun
left a comment
There was a problem hiding this comment.
Thanks for the PR!
This looks mostly good and makes sense :) Left a comment.
| // Get current branch name | ||
| use std::process::Command; | ||
| let output = Command::new("git") | ||
| .args(&["rev-parse", "--abbrev-ref", "HEAD"]) | ||
| .output(); | ||
|
|
|
any progress on this? |
This ensures that unreleased commits on feature/develop branches are properly matched with their corresponding pull requests.
Fixes issue where GitHub metadata (PR numbers, titles) was not populated for unreleased commits on non-default branches.
Also fixed .gitignore to ignore target/ insteand of /target
Description
When running git-cliff --unreleased without a specific range, it now uses
the current branch name for GitHub API calls instead of defaulting to the
repository's default branch.
Motivation and Context
Fixing of the following issue: #1274
How Has This Been Tested?
Tested against some repos in my company, where the error was discovered
Screenshots / Logs (if applicable)
Please everything is detailed in the issue linked to the PR
Types of Changes
Checklist: