Documentation
¶
Index ¶
- func CacheDir(source, tool, version, arch string) (string, error)
- func CacheFile(source, targetName, tool, version, arch string) (string, error)
- func CheckVersion(version, versionSpec string) (bool, error)
- func DownloadTool(ctx context.Context, logger any, url url.URL) (string, error)
- func ExtractTar(tarFile string, gz bool) (string, error)
- func ExtractZip(zipFile string) (string, error)
- func FindAllToolVersions(tool, arch string) ([]string, error)
- func FindTool(tool, arch, versionSpec string) (string, error)
- func GetToolCacheDirectory() (string, error)
- func ResolveToolDirectory(extractedPath string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDir ¶
CacheDir caches a tool dir into the GitHub Actions runner tool cache. If addPath is true, the tool will be added to the PATH.
func CacheFile ¶
CacheFile caches a tool file into the GitHub Actions runner tool cache. If addPath is true, the tool will be added to the PATH.
func CheckVersion ¶
CheckVersion checks if a version meets a version specification.
func DownloadTool ¶
DownloadTool downloads a tool from a URL and saves it to a temporary directory.
func ExtractTar ¶
ExtractTar extracts a tarball into a temporary directory. If gz is true, it will decompress the file.
func ExtractZip ¶
ExtractZip extracts a zip archive into a temporary directory.
func FindAllToolVersions ¶
FindAllToolVersions returns all versions of a tool in the GitHub Actions runner tool cache.
func FindTool ¶
FindTool finds a tool in the GitHub Actions runner tool cache that matches the version constraint. If the versionSpec isn't an explicit version then it will be evaluated as a semver constraint. Will return the path to the tool or an empty string if no tool is found.
func GetToolCacheDirectory ¶
GetToolCacheDirectory returns the path to the GitHub Actions runner tool cache directory.
func ResolveToolDirectory ¶ added in v0.0.7
ResolveToolDirectory navigates nested directories to find the actual tool location. It handles:
- Single root directory (steps into it)
- 'bin' subdirectory (steps into it if it exists after entering a single nested directory)
For example, if an archive extracts to:
extracted/ ├── jsonschema-v1.0.0/ │ ├── bin/ │ │ └── jsonschema │ └── lib/
This will resolve to: extracted/jsonschema-v1.0.0/bin.
Types ¶
This section is empty.