From a49c1675f873e8cf2123111285033ab0b2462ce2 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 17:21:22 -0800 Subject: [PATCH 01/11] feat: usage warning in SDK generation action --- internal/cli/speakeasy.go | 29 +++++++++++++++++++++++++++++ internal/git/git.go | 11 ++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/internal/cli/speakeasy.go b/internal/cli/speakeasy.go index 3a5cd8ba..4ab7704f 100644 --- a/internal/cli/speakeasy.go +++ b/internal/cli/speakeasy.go @@ -4,8 +4,10 @@ import ( "archive/tar" "archive/zip" "compress/gzip" + "encoding/json" "fmt" "io" + "net/http" "os" "os/exec" "path" @@ -183,3 +185,30 @@ func extractTarGZ(archive, dest string) error { return nil } + +func CheckFreeUsageAccess() (bool, error) { + apiURL := "https://example.com/v1/workspace/access?passive=true" + + resp, err := http.Get(apiURL) + if err != nil { + return false, fmt.Errorf("error making the API request: %w", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return false, fmt.Errorf("API request failed with status code: %d", resp.StatusCode) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return false, fmt.Errorf("error reading the response body: %w", err) + } + var accessDetails struct { + GenerationAllowed bool `json:"generation_allowed"` + } + if err := json.Unmarshal(body, &accessDetails); err != nil { + return false, fmt.Errorf("error unmarshaling the response: %w", err) + } + + return accessDetails.GenerationAllowed, nil +} diff --git a/internal/git/git.go b/internal/git/git.go index 73a87de5..6987059a 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "math" "net/url" "os" "os/exec" @@ -403,6 +404,14 @@ Based on: - OpenAPI Doc %s %s - Speakeasy CLI %s (%s) https://github.com/speakeasy-api/speakeasy%s`, releaseInfo.DocVersion, releaseInfo.DocLocation, releaseInfo.SpeakeasyVersion, releaseInfo.GenerationVersion, changelog) + // TODO: To be removed after we start blocking on usage limits. + if accessAllowed, err := cli.CheckFreeUsageAccess(); err == nil && !accessAllowed { + warningDate := time.Date(2024, time.March, 18, 0, 0, 0, 0, time.UTC) + daysToLimit := int(math.Round(warningDate.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24)) + body = fmt.Sprintf(`# 🚀 Time to Upgrade 🚀 +You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" + body + } + const maxBodyLength = 65536 if len(body) > maxBodyLength { @@ -629,7 +638,7 @@ func (g *Git) GetDownloadLink(version string) (string, string, error) { if err != nil { return "", "", fmt.Errorf("failed to get speakeasy cli releases: %w", err) } - + if len(releases) == 0 { return "", "", fmt.Errorf("no speakeasy cli releases found") } else { From b1e2067625c12de2884a402a6e62517dcf4d9433 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 17:24:03 -0800 Subject: [PATCH 02/11] feat: usage warning in SDK generation action --- internal/cli/speakeasy.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/cli/speakeasy.go b/internal/cli/speakeasy.go index 4ab7704f..76926cab 100644 --- a/internal/cli/speakeasy.go +++ b/internal/cli/speakeasy.go @@ -189,7 +189,17 @@ func extractTarGZ(archive, dest string) error { func CheckFreeUsageAccess() (bool, error) { apiURL := "https://example.com/v1/workspace/access?passive=true" - resp, err := http.Get(apiURL) + // Create a new request using http.NewRequest + req, err := http.NewRequest("GET", apiURL, nil) + if err != nil { + return false, fmt.Errorf("error creating the request: %w", err) + } + + apiKey := os.Getenv("SPEAKEASY_API_KEY") + req.Header.Set("x-api-key", apiKey) + + client := &http.Client{} + resp, err := client.Do(req) if err != nil { return false, fmt.Errorf("error making the API request: %w", err) } From 757c87da191cf4e3888594210ec41dd02a49010c Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 17:25:32 -0800 Subject: [PATCH 03/11] feat: usage warning in SDK generation action --- internal/cli/speakeasy.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/cli/speakeasy.go b/internal/cli/speakeasy.go index 76926cab..6c0d20b4 100644 --- a/internal/cli/speakeasy.go +++ b/internal/cli/speakeasy.go @@ -187,9 +187,8 @@ func extractTarGZ(archive, dest string) error { } func CheckFreeUsageAccess() (bool, error) { - apiURL := "https://example.com/v1/workspace/access?passive=true" - - // Create a new request using http.NewRequest + apiURL := "https://api.speakeasyapi.dev/v1/workspace/access?passive=true" + req, err := http.NewRequest("GET", apiURL, nil) if err != nil { return false, fmt.Errorf("error creating the request: %w", err) From 9eada732aadd52de22e7f879fe7e690b9e0bab35 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 21:46:54 -0800 Subject: [PATCH 04/11] feat: usage warning in SDK generation action --- internal/cli/speakeasy.go | 2 +- internal/git/git.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/cli/speakeasy.go b/internal/cli/speakeasy.go index 6c0d20b4..c9b578fa 100644 --- a/internal/cli/speakeasy.go +++ b/internal/cli/speakeasy.go @@ -188,7 +188,7 @@ func extractTarGZ(archive, dest string) error { func CheckFreeUsageAccess() (bool, error) { apiURL := "https://api.speakeasyapi.dev/v1/workspace/access?passive=true" - + req, err := http.NewRequest("GET", apiURL, nil) if err != nil { return false, fmt.Errorf("error creating the request: %w", err) diff --git a/internal/git/git.go b/internal/git/git.go index 6987059a..6f0aee1e 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -410,6 +410,8 @@ Based on: daysToLimit := int(math.Round(warningDate.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24)) body = fmt.Sprintf(`# 🚀 Time to Upgrade 🚀 You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" + body + } else { + return err } const maxBodyLength = 65536 From 6878de647d18bc4bfdfb33c122aec7d76966669d Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 21:58:15 -0800 Subject: [PATCH 05/11] feat: usage warning in SDK generation action --- .github/workflows/sdk-generation.yaml | 46 +++++++++++++-------------- action.yml | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/sdk-generation.yaml b/.github/workflows/sdk-generation.yaml index 25cc3991..99fc72d7 100644 --- a/.github/workflows/sdk-generation.yaml +++ b/.github/workflows/sdk-generation.yaml @@ -216,7 +216,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: validate - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 with: speakeasy_version: ${{ inputs.speakeasy_version }} openapi_doc_location: ${{ inputs.openapi_doc_location }} @@ -247,7 +247,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -295,7 +295,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: generate - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 with: speakeasy_version: ${{ inputs.speakeasy_version }} openapi_doc_location: ${{ inputs.openapi_doc_location }} @@ -333,7 +333,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -380,7 +380,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -425,7 +425,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -472,7 +472,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -520,7 +520,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -571,7 +571,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -616,7 +616,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -660,7 +660,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -707,7 +707,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -750,7 +750,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -797,7 +797,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -844,7 +844,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -896,7 +896,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: Finalize - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 with: github_access_token: ${{ secrets.github_access_token }} languages: ${{ inputs.languages }} @@ -926,7 +926,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -980,7 +980,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1031,7 +1031,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1101,7 +1101,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1157,7 +1157,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1203,7 +1203,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1247,7 +1247,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} diff --git a/action.yml b/action.yml index 053a5592..67647a3c 100644 --- a/action.yml +++ b/action.yml @@ -229,7 +229,7 @@ outputs: description: "The location of the OpenAPI document used for generation" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14.44" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }} From 0798883a71d1a475ab0b277d465d58f8e24c3abc Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 22:09:13 -0800 Subject: [PATCH 06/11] feat: update --- .github/workflows/sdk-generation.yaml | 46 +++++++++++++-------------- action.yml | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/sdk-generation.yaml b/.github/workflows/sdk-generation.yaml index 99fc72d7..25cc3991 100644 --- a/.github/workflows/sdk-generation.yaml +++ b/.github/workflows/sdk-generation.yaml @@ -216,7 +216,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: validate - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 with: speakeasy_version: ${{ inputs.speakeasy_version }} openapi_doc_location: ${{ inputs.openapi_doc_location }} @@ -247,7 +247,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -295,7 +295,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: generate - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 with: speakeasy_version: ${{ inputs.speakeasy_version }} openapi_doc_location: ${{ inputs.openapi_doc_location }} @@ -333,7 +333,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -380,7 +380,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -425,7 +425,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -472,7 +472,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -520,7 +520,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -571,7 +571,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -616,7 +616,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -660,7 +660,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -707,7 +707,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -750,7 +750,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -797,7 +797,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -844,7 +844,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -896,7 +896,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: Finalize - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 with: github_access_token: ${{ secrets.github_access_token }} languages: ${{ inputs.languages }} @@ -926,7 +926,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -980,7 +980,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1031,7 +1031,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1101,7 +1101,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1157,7 +1157,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1203,7 +1203,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} @@ -1247,7 +1247,7 @@ jobs: env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - id: log-result - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 if: always() with: speakeasy_version: ${{ inputs.speakeasy_version }} diff --git a/action.yml b/action.yml index 67647a3c..053a5592 100644 --- a/action.yml +++ b/action.yml @@ -229,7 +229,7 @@ outputs: description: "The location of the OpenAPI document used for generation" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14.44" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }} From 0f91f81b977ca168e609391040dba8dd53e7aba1 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 22 Feb 2024 22:09:40 -0800 Subject: [PATCH 07/11] feat: update --- internal/git/git.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/git/git.go b/internal/git/git.go index 6f0aee1e..6987059a 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -410,8 +410,6 @@ Based on: daysToLimit := int(math.Round(warningDate.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24)) body = fmt.Sprintf(`# 🚀 Time to Upgrade 🚀 You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" + body - } else { - return err } const maxBodyLength = 65536 From decb965f4d5c1e8aaae13cbd16ebf5993651b621 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Fri, 23 Feb 2024 07:57:01 -0800 Subject: [PATCH 08/11] feat: update --- internal/git/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/git/git.go b/internal/git/git.go index 6987059a..090ba7f9 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -408,8 +408,8 @@ Based on: if accessAllowed, err := cli.CheckFreeUsageAccess(); err == nil && !accessAllowed { warningDate := time.Date(2024, time.March, 18, 0, 0, 0, 0, time.UTC) daysToLimit := int(math.Round(warningDate.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24)) - body = fmt.Sprintf(`# 🚀 Time to Upgrade 🚀 -You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" + body + body += fmt.Sprintf(`\n\n\n# 🚀 Time to Upgrade 🚀 +You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" } const maxBodyLength = 65536 From 8ff15765b6cbf1df3271683d8c1c750c66f15368 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Fri, 23 Feb 2024 09:56:38 -0800 Subject: [PATCH 09/11] feat: update --- .github/workflows/sdk-generation.yaml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-generation.yaml b/.github/workflows/sdk-generation.yaml index 25cc3991..2c39d3f4 100644 --- a/.github/workflows/sdk-generation.yaml +++ b/.github/workflows/sdk-generation.yaml @@ -896,7 +896,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: Finalize - uses: speakeasy-api/sdk-generation-action@v14 + uses: speakeasy-api/sdk-generation-action@v14.44 with: github_access_token: ${{ secrets.github_access_token }} languages: ${{ inputs.languages }} diff --git a/action.yml b/action.yml index 053a5592..67647a3c 100644 --- a/action.yml +++ b/action.yml @@ -229,7 +229,7 @@ outputs: description: "The location of the OpenAPI document used for generation" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14.44" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }} From e5df5c1e7b3171b5b5b46f7e970ef09dc527e4e0 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Fri, 23 Feb 2024 10:03:31 -0800 Subject: [PATCH 10/11] feat: update --- internal/git/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/git/git.go b/internal/git/git.go index 090ba7f9..8d9e2532 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -408,7 +408,7 @@ Based on: if accessAllowed, err := cli.CheckFreeUsageAccess(); err == nil && !accessAllowed { warningDate := time.Date(2024, time.March, 18, 0, 0, 0, 0, time.UTC) daysToLimit := int(math.Round(warningDate.Sub(time.Now().Truncate(24*time.Hour)).Hours() / 24)) - body += fmt.Sprintf(`\n\n\n# 🚀 Time to Upgrade 🚀 + body += "\n\n\n" + fmt.Sprintf(`## 🚀 Time to Upgrade 🚀 You have exceeded the limit of one free generated SDK. Please reach out to the Speakeasy team in the next %d days to ensure continued access`, daysToLimit) + "\n\n" } From 72d14f73e782b9a9f78d637c6956afac89dd2a57 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Fri, 23 Feb 2024 10:11:28 -0800 Subject: [PATCH 11/11] feat: update --- .github/workflows/sdk-generation.yaml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-generation.yaml b/.github/workflows/sdk-generation.yaml index 2c39d3f4..25cc3991 100644 --- a/.github/workflows/sdk-generation.yaml +++ b/.github/workflows/sdk-generation.yaml @@ -896,7 +896,7 @@ jobs: - name: Tune GitHub-hosted runner network uses: smorimoto/tune-github-hosted-runner-network@v1 - id: Finalize - uses: speakeasy-api/sdk-generation-action@v14.44 + uses: speakeasy-api/sdk-generation-action@v14 with: github_access_token: ${{ secrets.github_access_token }} languages: ${{ inputs.languages }} diff --git a/action.yml b/action.yml index 67647a3c..053a5592 100644 --- a/action.yml +++ b/action.yml @@ -229,7 +229,7 @@ outputs: description: "The location of the OpenAPI document used for generation" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14.44" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v14" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }}