Fix GitHub action URL (#80)

Our docs and default value for the GitHub action cache URL were
referring to the
[wrong](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md)
environment variable.

I was under the impression that the underlying library ends up checking
for the correct variable later so this would be only cosmetic, but a
user
[confirmed](https://github.com/pulumi/pulumi-docker-build/issues/77#issuecomment-2135621983)
this does appear to break things.

I brought over an old test I had written while this was still in the
pulumi-docker repo, but unfortunately it doesn't currently test GHA due
to ci-mgmt limitations
https://github.com/pulumi/pulumi-docker-build/issues/82.

Fixes https://github.com/pulumi/pulumi-docker-build/issues/77.
This commit is contained in:
Bryce Lampe
2024-05-29 05:29:58 -07:00
committed by GitHub
parent c9e5913af1
commit f0aaf7095d
22 changed files with 2228 additions and 64 deletions

View File

@@ -849,7 +849,7 @@ type CacheFromGitHubActions struct {
Token *string `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url *string `pulumi:"url"`
@@ -874,7 +874,7 @@ func (val *CacheFromGitHubActions) Defaults() *CacheFromGitHubActions {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
url_ := d.(string)
tmp.Url = &url_
}
@@ -908,7 +908,7 @@ type CacheFromGitHubActionsArgs struct {
Token pulumi.StringPtrInput `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url pulumi.StringPtrInput `pulumi:"url"`
@@ -931,7 +931,7 @@ func (val *CacheFromGitHubActionsArgs) Defaults() *CacheFromGitHubActionsArgs {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
tmp.Url = pulumi.StringPtr(d.(string))
}
}
@@ -1052,7 +1052,7 @@ func (o CacheFromGitHubActionsOutput) Token() pulumi.StringPtrOutput {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheFromGitHubActionsOutput) Url() pulumi.StringPtrOutput {
@@ -1119,7 +1119,7 @@ func (o CacheFromGitHubActionsPtrOutput) Token() pulumi.StringPtrOutput {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheFromGitHubActionsPtrOutput) Url() pulumi.StringPtrOutput {
@@ -2384,7 +2384,7 @@ type CacheToGitHubActions struct {
Token *string `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url *string `pulumi:"url"`
@@ -2417,7 +2417,7 @@ func (val *CacheToGitHubActions) Defaults() *CacheToGitHubActions {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
url_ := d.(string)
tmp.Url = &url_
}
@@ -2455,7 +2455,7 @@ type CacheToGitHubActionsArgs struct {
Token pulumi.StringPtrInput `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url pulumi.StringPtrInput `pulumi:"url"`
@@ -2484,7 +2484,7 @@ func (val *CacheToGitHubActionsArgs) Defaults() *CacheToGitHubActionsArgs {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
tmp.Url = pulumi.StringPtr(d.(string))
}
}
@@ -2615,7 +2615,7 @@ func (o CacheToGitHubActionsOutput) Token() pulumi.StringPtrOutput {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheToGitHubActionsOutput) Url() pulumi.StringPtrOutput {
@@ -2702,7 +2702,7 @@ func (o CacheToGitHubActionsPtrOutput) Token() pulumi.StringPtrOutput {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheToGitHubActionsPtrOutput) Url() pulumi.StringPtrOutput {

View File

@@ -408,7 +408,7 @@ type CacheFromGitHubActions struct {
Token *string `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url *string `pulumi:"url"`
@@ -433,7 +433,7 @@ func (val *CacheFromGitHubActions) Defaults() *CacheFromGitHubActions {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
url_ := d.(string)
tmp.Url = &url_
}
@@ -456,7 +456,7 @@ type CacheFromGitHubActionsArgs struct {
Token pulumix.Input[*string] `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url pulumix.Input[*string] `pulumi:"url"`
@@ -479,7 +479,7 @@ func (val *CacheFromGitHubActionsArgs) Defaults() *CacheFromGitHubActionsArgs {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
tmp.Url = pulumix.Ptr(d.(string))
}
}
@@ -541,7 +541,7 @@ func (o CacheFromGitHubActionsOutput) Token() pulumix.Output[*string] {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheFromGitHubActionsOutput) Url() pulumix.Output[*string] {
@@ -1157,7 +1157,7 @@ type CacheToGitHubActions struct {
Token *string `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url *string `pulumi:"url"`
@@ -1190,7 +1190,7 @@ func (val *CacheToGitHubActions) Defaults() *CacheToGitHubActions {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
url_ := d.(string)
tmp.Url = &url_
}
@@ -1217,7 +1217,7 @@ type CacheToGitHubActionsArgs struct {
Token pulumix.Input[*string] `pulumi:"token"`
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
Url pulumix.Input[*string] `pulumi:"url"`
@@ -1246,7 +1246,7 @@ func (val *CacheToGitHubActionsArgs) Defaults() *CacheToGitHubActionsArgs {
}
}
if tmp.Url == nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_RUNTIME_URL"); d != nil {
if d := internal.GetEnvOrDefault("", nil, "ACTIONS_CACHE_URL"); d != nil {
tmp.Url = pulumix.Ptr(d.(string))
}
}
@@ -1318,7 +1318,7 @@ func (o CacheToGitHubActionsOutput) Token() pulumix.Output[*string] {
// The cache server URL to use for artifacts.
//
// Defaults to `$ACTIONS_RUNTIME_URL`, although a separate action like
// Defaults to `$ACTIONS_CACHE_URL`, although a separate action like
// `crazy-max/ghaction-github-runtime` is recommended to expose this
// environment variable to your jobs.
func (o CacheToGitHubActionsOutput) Url() pulumix.Output[*string] {