mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #2056] github.ref_name is not set to the branch/tag that HEAD points to. #987
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#987
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GROwen on GitHub (Oct 20, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2056
Bug report info
Command used with act
Describe issue
If a Git reference points to multiple branches the last pointer in the series is selected as the value for github.ref_name
i.e.
Expected behaviour (personally)
The values for "ref" and "ref_name" in the GitHub context are set to the branch/tag pointer that
HEADis pointing to i.e.Actual behaviour
See the output posted in the "Relevant log output" section.
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
I was trying to solve this and provide a PR but am uncertain of the broader implications of the change that would fix the issue for my scenario.
pkg/common/git/git.go:FindGetRef is responsible for setting the values. I'm assuming the requirement for this and not just the value set for head in pkg/common/git/git.go:FindGitRevision is to lookup any tags that would be related to the revision. Otherwise I'd expect the pointer for HEAD could be used?
It'd be helpful to have this assumption verified by someone more experienced with the project before I dive into a solution.
Expanding the existing tests to check for this scenario seems trivial although I don't think that explicitly checks for what would be output to github.ref_name. Could I have missed that somewhere?
@github-actions[bot] commented on GitHub (Apr 18, 2024):
Issue is stale and will be closed in 14 days unless there is new activity