[PR #633] [MERGED] Prefer go-git to find the reference name #1530

Closed
opened 2026-03-01 21:51:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/633
Author: @snazy
Created: 4/23/2021
Status: Merged
Merged: 5/3/2021
Merged by: @cplee

Base: masterHead: ref-from-go-git


📝 Commits (1)

  • ad9810e Prefer go-git to find the reference name

📊 Changes

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

View changed files

📝 pkg/common/git.go (+34 -0)

📄 Description

Walking the directory tree underneath .git/refs is not reliable, as it usually does not
return tags, especially for freshly cloned repos and/or tags fetched from a remote.

The go-git library provides an iterator over all git references.

This approach prefers a reference (tag, branch) from go-git, if found. If none is found,
it falls back to the previous implementation.


🔄 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/nektos/act/pull/633 **Author:** [@snazy](https://github.com/snazy) **Created:** 4/23/2021 **Status:** ✅ Merged **Merged:** 5/3/2021 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `ref-from-go-git` --- ### 📝 Commits (1) - [`ad9810e`](https://github.com/nektos/act/commit/ad9810effbeffb054312bf9db4f766417c0bd64d) Prefer go-git to find the reference name ### 📊 Changes **1 file changed** (+34 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/git.go` (+34 -0) </details> ### 📄 Description Walking the directory tree underneath `.git/refs` is not reliable, as it usually does not return tags, especially for freshly cloned repos and/or tags fetched from a remote. The go-git library provides an iterator over all git references. This approach prefers a reference (tag, branch) from go-git, if found. If none is found, it falls back to the previous implementation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:34 +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/act#1530
No description provided.