This adds support for retrieving the tarball or zip source artifact from a Github release. This is done through defining a "params.include_source_tarball" or "params.include_source_zip" boolean setting. With this, the resource will download the respective source artfact into the target directory as either "source.tar.gz" or "source.zip".
62 lines
1.3 KiB
Go
62 lines
1.3 KiB
Go
package resource
|
|
|
|
type Source struct {
|
|
User string `json:"user"`
|
|
Repository string `json:"repository"`
|
|
|
|
GitHubAPIURL string `json:"github_api_url"`
|
|
AccessToken string `json:"access_token"`
|
|
}
|
|
|
|
type CheckRequest struct {
|
|
Source Source `json:"source"`
|
|
Version Version `json:"version"`
|
|
}
|
|
|
|
type InRequest struct {
|
|
Source Source `json:"source"`
|
|
Version *Version `json:"version"`
|
|
Params InParams `json:"params"`
|
|
}
|
|
|
|
type InParams struct {
|
|
Globs []string `json:"globs"`
|
|
IncludeSourceTarball bool `json:"include_source_tarball"`
|
|
IncludeSourceZip bool `json:"include_source_zip"`
|
|
}
|
|
|
|
type InResponse struct {
|
|
Version Version `json:"version"`
|
|
Metadata []MetadataPair `json:"metadata"`
|
|
}
|
|
|
|
type OutRequest struct {
|
|
Source Source `json:"source"`
|
|
Params OutParams `json:"params"`
|
|
}
|
|
|
|
type OutParams struct {
|
|
NamePath string `json:"name"`
|
|
BodyPath string `json:"body"`
|
|
TagPath string `json:"tag"`
|
|
CommitishPath string `json:"commitish"`
|
|
|
|
Globs []string `json:"globs"`
|
|
}
|
|
|
|
type OutResponse struct {
|
|
Version Version `json:"version"`
|
|
Metadata []MetadataPair `json:"metadata"`
|
|
}
|
|
|
|
type Version struct {
|
|
Tag string `json:"tag"`
|
|
}
|
|
|
|
type MetadataPair struct {
|
|
Name string `json:"name"`
|
|
Value string `json:"value"`
|
|
URL string `json:"url"`
|
|
Markdown bool `json:"markdown"`
|
|
}
|