Skip to content

Commit

Permalink
Fixed ref labels on PRs using PR head branch instead of base
Browse files Browse the repository at this point in the history
  • Loading branch information
fheinecke committed Mar 18, 2024
1 parent 5e20be2 commit 660c61e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Fixed ref labels on PRs using PR head branch instead of base

## [0.0.8] - 2024-03-16
### Added
Expand Down
8 changes: 4 additions & 4 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ func makeRef(run *github.WorkflowRun) string {
}

for _, pr := range run.PullRequests {
prBaseBranch := pr.GetBase()
prHeadBranch := pr.GetHead()

if prBaseBranch.GetSHA() == headSha ||
prBaseBranch.GetRef() == headBranch {
return headBranch
if prHeadBranch.GetSHA() == headSha ||
prHeadBranch.GetRef() == headBranch {
return pr.GetBase().GetRef()
}
}

Expand Down

0 comments on commit 660c61e

Please sign in to comment.