Skip to content
This repository was archived by the owner on Feb 24, 2024. It is now read-only.

Test adding oras command for shpc #17

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ inputs:
default: 'false'
runs:
using: 'docker'
image: 'docker://ghcr.io/autamus/binoc:latest'
image: 'Dockerfile'

branding:
icon: 'activity'
Expand Down
8 changes: 7 additions & 1 deletion parsers/shpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (s SHPC) Encode(pkg Package) (result string, err error) {
// ContainerSpec is a wrapper struct for a container.yaml
type ContainerSpec struct {
Name string `yaml:"name,omitempty"`
Oras string `yaml:"oras,omitempty"`
Docker string `yaml:"docker,omitempty"`
Gh string `yaml:"gh,omitempty"`
Url string `yaml:"url,omitempty"`
Expand Down Expand Up @@ -144,7 +145,7 @@ func (s *ContainerSpec) GetURL() (result string) {
if len(s.Filter) > 0 {
result = result + ":" + s.Filter[0]
}
} else {
} else if s.Gh != "" {
result = "https://github.com/" + s.Gh
}
return result
Expand Down Expand Up @@ -174,6 +175,11 @@ func (s *ContainerSpec) GetDescription() string {
func (s *ContainerSpec) CheckUpdate() (outOfDate bool, output results.Result) {
outOfDate = false
url := s.GetURL()

// Cut out early if we don't get a url
if url == "" {
return outOfDate, results.Result{}
}
docker := strings.HasPrefix(url, "docker://")

// Check for new latest version
Expand Down