From 0635514ddfab4d2fc4ca2dfb729b0b59a0fe97da Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Tue, 15 Feb 2022 02:06:01 +0000 Subject: [PATCH 1/8] first stab wip move to method param flushing out --- internal/codespaces/api/api.go | 54 ++++++++++++++++++++++++++++ pkg/cmd/codespace/common.go | 1 + pkg/cmd/codespace/edit.go | 65 ++++++++++++++++++++++++++++++++++ pkg/cmd/codespace/mock_api.go | 55 ++++++++++++++++++++++++++++ pkg/cmd/codespace/root.go | 1 + 5 files changed, 176 insertions(+) create mode 100644 pkg/cmd/codespace/edit.go diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index a207f562c..9bd41db5d 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -686,6 +686,60 @@ func (a *API) DeleteCodespace(ctx context.Context, codespaceName string) error { return nil } +type EditCodespaceParams struct { + DisplayName string + IdleTimeoutMinutes int + Machine string +} + +type editRequest struct { + DisplayName string `json:"display_name,omitempty"` + IdleTimeoutMinutes int `json:"idle_timeout_minutes,omitempty"` + Machine string `json:"machine"` +} + +func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *EditCodespaceParams) (*Codespace, error) { + requestBody, err := json.Marshal(editRequest{ + DisplayName: params.DisplayName, + IdleTimeoutMinutes: params.IdleTimeoutMinutes, + Machine: params.Machine, + }) + fmt.Printf("requestBody: %s\n", requestBody) + if err != nil { + return nil, fmt.Errorf("error marshaling request: %w", err) + } + + req, err := http.NewRequest(http.MethodPatch, a.githubAPI+"/user/codespaces/"+codespaceName, bytes.NewBuffer(requestBody)) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + + a.setHeaders(req) + resp, err := a.do(ctx, req, "/user/codespaces") + if err != nil { + return nil, fmt.Errorf("error making request: %w", err) + } + defer resp.Body.Close() + + if resp.StatusCode == http.StatusAccepted { + return nil, errProvisioningInProgress // RPC finished before result of creation known + } else if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { + return nil, api.HandleHTTPError(resp) + } + + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + + var response Codespace + if err := json.Unmarshal(b, &response); err != nil { + return nil, fmt.Errorf("error unmarshaling response: %w", err) + } + + return &response, nil +} + type getCodespaceRepositoryContentsResponse struct { Content string `json:"content"` } diff --git a/pkg/cmd/codespace/common.go b/pkg/cmd/codespace/common.go index d7273edb8..bdc4d6ef4 100644 --- a/pkg/cmd/codespace/common.go +++ b/pkg/cmd/codespace/common.go @@ -62,6 +62,7 @@ type apiClient interface { StartCodespace(ctx context.Context, name string) error StopCodespace(ctx context.Context, name string) error CreateCodespace(ctx context.Context, params *api.CreateCodespaceParams) (*api.Codespace, error) + EditCodespace(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) GetRepository(ctx context.Context, nwo string) (*api.Repository, error) AuthorizedKeys(ctx context.Context, user string) ([]byte, error) GetCodespaceRegionLocation(ctx context.Context) (string, error) diff --git a/pkg/cmd/codespace/edit.go b/pkg/cmd/codespace/edit.go new file mode 100644 index 000000000..16b4d3ad2 --- /dev/null +++ b/pkg/cmd/codespace/edit.go @@ -0,0 +1,65 @@ +package codespace + +import ( + "context" + "fmt" + "time" + + "github.com/cli/cli/v2/internal/codespaces/api" + "github.com/spf13/cobra" +) + +type editOptions struct { + codespaceName string + displayName string + idleTimeout time.Duration + machine string +} + +func newEditCmd(app *App) *cobra.Command { + opts := editOptions{} + + editCmd := &cobra.Command{ + Use: "edit", + Short: "Edit a codespace", + Args: noArgsConstraint, + RunE: func(cmd *cobra.Command, args []string) error { + return app.Edit(cmd.Context(), opts) + }, + } + + editCmd.Flags().StringVarP(&opts.codespaceName, "codespace", "c", "", "Name of the codespace") + editCmd.Flags().StringVarP(&opts.displayName, "displayName", "d", "", "display name") + editCmd.Flags().DurationVar(&opts.idleTimeout, "idle-timeout", 0, "allowed inactivity before codespace is stopped, e.g. \"10m\", \"1h\"") + editCmd.Flags().StringVarP(&opts.machine, "machine", "m", "", "hardware specifications for the VM") + + return editCmd +} + +// Edits a codespace +func (a *App) Edit(ctx context.Context, opts editOptions) error { + userInputs := struct { + CodespaceName string + DisplayName string + IdleTimeout time.Duration + SKU string + }{ + CodespaceName: opts.codespaceName, + DisplayName: opts.displayName, + IdleTimeout: opts.idleTimeout, + SKU: opts.machine, + } + a.StartProgressIndicatorWithLabel("Editing codespace") + codespace, err := a.apiClient.EditCodespace(ctx, userInputs.CodespaceName, &api.EditCodespaceParams{ + DisplayName: userInputs.DisplayName, + IdleTimeoutMinutes: int(userInputs.IdleTimeout.Minutes()), + Machine: userInputs.SKU, + }) + a.StopProgressIndicator() + if err != nil { + return fmt.Errorf("error editing codespace: %w", err) + } + + fmt.Fprintln(a.io.Out, codespace.Name) + return nil +} diff --git a/pkg/cmd/codespace/mock_api.go b/pkg/cmd/codespace/mock_api.go index fd275e802..220750afe 100644 --- a/pkg/cmd/codespace/mock_api.go +++ b/pkg/cmd/codespace/mock_api.go @@ -25,6 +25,9 @@ import ( // DeleteCodespaceFunc: func(ctx context.Context, name string) error { // panic("mock out the DeleteCodespace method") // }, +// EditCodespaceFunc: func(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) { +// panic("mock out the EditCodespace method") +// }, // GetCodespaceFunc: func(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) { // panic("mock out the GetCodespace method") // }, @@ -71,6 +74,9 @@ type apiClientMock struct { // DeleteCodespaceFunc mocks the DeleteCodespace method. DeleteCodespaceFunc func(ctx context.Context, name string) error + // EditCodespaceFunc mocks the EditCodespace method. + EditCodespaceFunc func(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) + // GetCodespaceFunc mocks the GetCodespace method. GetCodespaceFunc func(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) @@ -124,6 +130,15 @@ type apiClientMock struct { // Name is the name argument value. Name string } + // EditCodespace holds details about calls to the EditCodespace method. + EditCodespace []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // CodespaceName is the codespaceName argument value. + CodespaceName string + // Params is the params argument value. + Params *api.EditCodespaceParams + } // GetCodespace holds details about calls to the GetCodespace method. GetCodespace []struct { // Ctx is the ctx argument value. @@ -204,6 +219,7 @@ type apiClientMock struct { lockAuthorizedKeys sync.RWMutex lockCreateCodespace sync.RWMutex lockDeleteCodespace sync.RWMutex + lockEditCodespace sync.RWMutex lockGetCodespace sync.RWMutex lockGetCodespaceRegionLocation sync.RWMutex lockGetCodespaceRepoSuggestions sync.RWMutex @@ -321,6 +337,45 @@ func (mock *apiClientMock) DeleteCodespaceCalls() []struct { return calls } +// EditCodespace calls EditCodespaceFunc. +func (mock *apiClientMock) EditCodespace(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) { + if mock.EditCodespaceFunc == nil { + panic("apiClientMock.EditCodespaceFunc: method is nil but apiClient.EditCodespace was just called") + } + callInfo := struct { + Ctx context.Context + CodespaceName string + Params *api.EditCodespaceParams + }{ + Ctx: ctx, + CodespaceName: codespaceName, + Params: params, + } + mock.lockEditCodespace.Lock() + mock.calls.EditCodespace = append(mock.calls.EditCodespace, callInfo) + mock.lockEditCodespace.Unlock() + return mock.EditCodespaceFunc(ctx, codespaceName, params) +} + +// EditCodespaceCalls gets all the calls that were made to EditCodespace. +// Check the length with: +// len(mockedapiClient.EditCodespaceCalls()) +func (mock *apiClientMock) EditCodespaceCalls() []struct { + Ctx context.Context + CodespaceName string + Params *api.EditCodespaceParams +} { + var calls []struct { + Ctx context.Context + CodespaceName string + Params *api.EditCodespaceParams + } + mock.lockEditCodespace.RLock() + calls = mock.calls.EditCodespace + mock.lockEditCodespace.RUnlock() + return calls +} + // GetCodespace calls GetCodespaceFunc. func (mock *apiClientMock) GetCodespace(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) { if mock.GetCodespaceFunc == nil { diff --git a/pkg/cmd/codespace/root.go b/pkg/cmd/codespace/root.go index 5b2c0d8fc..0a04d2fdd 100644 --- a/pkg/cmd/codespace/root.go +++ b/pkg/cmd/codespace/root.go @@ -12,6 +12,7 @@ func NewRootCmd(app *App) *cobra.Command { root.AddCommand(newCodeCmd(app)) root.AddCommand(newCreateCmd(app)) + root.AddCommand(newEditCmd(app)) root.AddCommand(newDeleteCmd(app)) root.AddCommand(newListCmd(app)) root.AddCommand(newLogsCmd(app)) From 4d45bc765495e48aeba8f23b07fad03ddf268bee Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Tue, 15 Feb 2022 20:11:03 +0000 Subject: [PATCH 2/8] more changes --- internal/codespaces/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index 9bd41db5d..fc94b22fd 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -695,7 +695,7 @@ type EditCodespaceParams struct { type editRequest struct { DisplayName string `json:"display_name,omitempty"` IdleTimeoutMinutes int `json:"idle_timeout_minutes,omitempty"` - Machine string `json:"machine"` + Machine string `json:"machine,omitempty"` } func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *EditCodespaceParams) (*Codespace, error) { From e3ff873d649ce3675a2dc5e7672f41165099b1e6 Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Wed, 16 Feb 2022 00:00:13 +0000 Subject: [PATCH 3/8] since we can change the machine name, we should probably allow them to list it --- internal/codespaces/api/api.go | 20 ++++++++++++++++---- pkg/cmd/codespace/edit.go | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index fc94b22fd..1653e06ed 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -170,6 +170,7 @@ type Codespace struct { State string `json:"state"` GitStatus CodespaceGitStatus `json:"git_status"` Connection CodespaceConnection `json:"connection"` + Machine CodespaceMachine `json:"machine"` } type CodespaceGitStatus struct { @@ -180,6 +181,15 @@ type CodespaceGitStatus struct { HasUncommitedChanges bool `json:"has_uncommited_changes"` } +type CodespaceMachine struct { + Name string `json:"name"` + DisplayName string `json:"display_name"` + OperatingSystem string `json:"operating_system"` + StorageInBytes int `json:"storage_in_bytes"` + MemoryInBytes int `json:"memory_in_bytes"` + CPUCount int `json:"cpus"` +} + const ( // CodespaceStateAvailable is the state for a running codespace environment. CodespaceStateAvailable = "Available" @@ -207,6 +217,7 @@ var CodespaceFields = []string{ "gitStatus", "createdAt", "lastUsedAt", + "machineName", } func (c *Codespace) ExportData(fields []string) map[string]interface{} { @@ -219,6 +230,8 @@ func (c *Codespace) ExportData(fields []string) map[string]interface{} { data[f] = c.Owner.Login case "repository": data[f] = c.Repository.FullName + case "machineName": + data[f] = c.Machine.Name case "gitStatus": data[f] = map[string]interface{}{ "ref": c.GitStatus.Ref, @@ -265,6 +278,7 @@ func (a *API) ListCodespaces(ctx context.Context, limit int) (codespaces []*Code var response struct { Codespaces []*Codespace `json:"codespaces"` } + dec := json.NewDecoder(resp.Body) if err := dec.Decode(&response); err != nil { return nil, fmt.Errorf("error unmarshaling response: %w", err) @@ -704,7 +718,7 @@ func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *E IdleTimeoutMinutes: params.IdleTimeoutMinutes, Machine: params.Machine, }) - fmt.Printf("requestBody: %s\n", requestBody) + if err != nil { return nil, fmt.Errorf("error marshaling request: %w", err) } @@ -721,9 +735,7 @@ func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *E } defer resp.Body.Close() - if resp.StatusCode == http.StatusAccepted { - return nil, errProvisioningInProgress // RPC finished before result of creation known - } else if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { return nil, api.HandleHTTPError(resp) } diff --git a/pkg/cmd/codespace/edit.go b/pkg/cmd/codespace/edit.go index 16b4d3ad2..6b1af1c8c 100644 --- a/pkg/cmd/codespace/edit.go +++ b/pkg/cmd/codespace/edit.go @@ -60,6 +60,6 @@ func (a *App) Edit(ctx context.Context, opts editOptions) error { return fmt.Errorf("error editing codespace: %w", err) } - fmt.Fprintln(a.io.Out, codespace.Name) + fmt.Fprintln(a.io.Out, codespace.DisplayName) return nil } From 133be27d997bf2935143da11b0011f798f84538a Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Wed, 16 Feb 2022 13:35:46 +0000 Subject: [PATCH 4/8] wip tests --- internal/codespaces/api/api_test.go | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/internal/codespaces/api/api_test.go b/internal/codespaces/api/api_test.go index af394cf7e..fe0663644 100644 --- a/internal/codespaces/api/api_test.go +++ b/internal/codespaces/api/api_test.go @@ -6,6 +6,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "reflect" "strconv" "testing" ) @@ -265,3 +266,48 @@ func TestRetries(t *testing.T) { t.Fatalf("expected codespace name to be %q but got %q", csName, cs.Name) } } + +func TestCodespace_ExportData(t *testing.T) { + type fields struct { + Name string + CreatedAt string + DisplayName string + LastUsedAt string + Owner User + Repository Repository + State string + GitStatus CodespaceGitStatus + Connection CodespaceConnection + Machine CodespaceMachine + } + type args struct { + fields []string + } + tests := []struct { + name string + fields fields + args args + want map[string]interface{} + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &Codespace{ + Name: tt.fields.Name, + CreatedAt: tt.fields.CreatedAt, + DisplayName: tt.fields.DisplayName, + LastUsedAt: tt.fields.LastUsedAt, + Owner: tt.fields.Owner, + Repository: tt.fields.Repository, + State: tt.fields.State, + GitStatus: tt.fields.GitStatus, + Connection: tt.fields.Connection, + Machine: tt.fields.Machine, + } + if got := c.ExportData(tt.args.fields); !reflect.DeepEqual(got, tt.want) { + t.Errorf("Codespace.ExportData() = %v, want %v", got, tt.want) + } + }) + } +} From 3d093d1a95a1ace4d9af7dee016e43a72883a1a9 Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Thu, 17 Feb 2022 02:23:17 +0000 Subject: [PATCH 5/8] some tests --- internal/codespaces/api/api_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/codespaces/api/api_test.go b/internal/codespaces/api/api_test.go index fe0663644..35616b42d 100644 --- a/internal/codespaces/api/api_test.go +++ b/internal/codespaces/api/api_test.go @@ -289,7 +289,18 @@ func TestCodespace_ExportData(t *testing.T) { args args want map[string]interface{} }{ - // TODO: Add test cases. + { + name: "just name", + fields: fields{ + Name: "test", + }, + args: args{ + fields: []string{"name"}, + }, + want: map[string]interface{}{ + "name": "test", + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 86feaff6a9f44be7dd83411fd4b970e8b15b211c Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Thu, 24 Feb 2022 20:21:06 +0000 Subject: [PATCH 6/8] little bit of testing --- internal/codespaces/api/api_test.go | 112 ++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/internal/codespaces/api/api_test.go b/internal/codespaces/api/api_test.go index 35616b42d..ebbbe5209 100644 --- a/internal/codespaces/api/api_test.go +++ b/internal/codespaces/api/api_test.go @@ -301,6 +301,34 @@ func TestCodespace_ExportData(t *testing.T) { "name": "test", }, }, + { + name: "just owner", + fields: fields{ + Owner: User{ + Login: "test", + }, + }, + args: args{ + fields: []string{"owner"}, + }, + want: map[string]interface{}{ + "owner": "test", + }, + }, + { + name: "just machine", + fields: fields{ + Machine: CodespaceMachine{ + Name: "test", + }, + }, + args: args{ + fields: []string{"machineName"}, + }, + want: map[string]interface{}{ + "machineName": "test", + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -322,3 +350,87 @@ func TestCodespace_ExportData(t *testing.T) { }) } } + +func createFakeEditServer(t *testing.T, codespaceName string) *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + checkPath := "/user/codespaces/" + codespaceName + + if r.URL.Path != checkPath { + t.Fatal("Incorrect path") + } + + if r.Method != http.MethodPatch { + t.Fatal("Incorrect method") + } + + body := r.Body + if body == nil { + t.Fatal("No body") + } + defer body.Close() + + var data map[string]interface{} + err := json.NewDecoder(body).Decode(&data) + + if err != nil { + t.Fatal(err) + } + + if data["display_name"] != "changeTo" { + t.Fatal("Incorrect display name") + } + + response := Codespace{ + DisplayName: "changeTo", + } + + responseData, _ := json.Marshal(response) + fmt.Fprint(w, string(responseData)) + })) +} +func TestAPI_EditCodespace(t *testing.T) { + type args struct { + ctx context.Context + codespaceName string + params *EditCodespaceParams + } + tests := []struct { + name string + args args + want *Codespace + wantErr bool + }{ + { + name: "success", + args: args{ + ctx: context.Background(), + codespaceName: "test", + params: &EditCodespaceParams{ + DisplayName: "changeTo", + }, + }, + want: &Codespace{ + DisplayName: "changeTo", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + svr := createFakeEditServer(t, tt.args.codespaceName) + defer svr.Close() + + a := &API{ + client: &http.Client{}, + githubAPI: svr.URL, + } + got, err := a.EditCodespace(tt.args.ctx, tt.args.codespaceName, tt.args.params) + if (err != nil) != tt.wantErr { + t.Errorf("API.EditCodespace() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("API.EditCodespace() = %v, want %v", got.DisplayName, tt.want.DisplayName) + } + }) + } +} From edfaac23dac6ba49e66444872b74c2cf3083af79 Mon Sep 17 00:00:00 2001 From: Patrick Veverka Date: Wed, 2 Mar 2022 13:17:57 +0000 Subject: [PATCH 7/8] updates from review --- internal/codespaces/api/api.go | 14 ++------------ pkg/cmd/codespace/edit.go | 3 +-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/internal/codespaces/api/api.go b/internal/codespaces/api/api.go index 1653e06ed..9aa19da2e 100644 --- a/internal/codespaces/api/api.go +++ b/internal/codespaces/api/api.go @@ -701,23 +701,13 @@ func (a *API) DeleteCodespace(ctx context.Context, codespaceName string) error { } type EditCodespaceParams struct { - DisplayName string - IdleTimeoutMinutes int - Machine string -} - -type editRequest struct { DisplayName string `json:"display_name,omitempty"` IdleTimeoutMinutes int `json:"idle_timeout_minutes,omitempty"` Machine string `json:"machine,omitempty"` } func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *EditCodespaceParams) (*Codespace, error) { - requestBody, err := json.Marshal(editRequest{ - DisplayName: params.DisplayName, - IdleTimeoutMinutes: params.IdleTimeoutMinutes, - Machine: params.Machine, - }) + requestBody, err := json.Marshal(params) if err != nil { return nil, fmt.Errorf("error marshaling request: %w", err) @@ -735,7 +725,7 @@ func (a *API) EditCodespace(ctx context.Context, codespaceName string, params *E } defer resp.Body.Close() - if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { + if resp.StatusCode != http.StatusOK { return nil, api.HandleHTTPError(resp) } diff --git a/pkg/cmd/codespace/edit.go b/pkg/cmd/codespace/edit.go index 6b1af1c8c..70935d0eb 100644 --- a/pkg/cmd/codespace/edit.go +++ b/pkg/cmd/codespace/edit.go @@ -50,7 +50,7 @@ func (a *App) Edit(ctx context.Context, opts editOptions) error { SKU: opts.machine, } a.StartProgressIndicatorWithLabel("Editing codespace") - codespace, err := a.apiClient.EditCodespace(ctx, userInputs.CodespaceName, &api.EditCodespaceParams{ + _, err := a.apiClient.EditCodespace(ctx, userInputs.CodespaceName, &api.EditCodespaceParams{ DisplayName: userInputs.DisplayName, IdleTimeoutMinutes: int(userInputs.IdleTimeout.Minutes()), Machine: userInputs.SKU, @@ -60,6 +60,5 @@ func (a *App) Edit(ctx context.Context, opts editOptions) error { return fmt.Errorf("error editing codespace: %w", err) } - fmt.Fprintln(a.io.Out, codespace.DisplayName) return nil } From 0cce0e154344fe31e50ac6375f67212593c1b53b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 14:29:49 +0000 Subject: [PATCH 8/8] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/go.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/releases.yml | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d46c0bcf3..720f1210e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Initialize CodeQL uses: github/codeql-action/init@v1 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f12d8f0d0..f3f5502ea 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,7 +15,7 @@ jobs: go-version: 1.16 - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Cache Go modules uses: actions/cache@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 78d94c78e..90e2c67e0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: go-version: 1.16 - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Verify dependencies run: | diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 6511fc71c..3e7f6cf2f 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Go 1.16 uses: actions/setup-go@v2 with: @@ -44,7 +44,7 @@ jobs: GORELEASER_CURRENT_TAG: ${{steps.changelog.outputs.tag-name}} CERT_PASSWORD: ${{secrets.WINDOWS_CERT_PASSWORD}} - name: Checkout documentation site - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: github/cli.github.com path: site @@ -128,7 +128,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download gh.exe id: download_exe shell: bash @@ -188,7 +188,7 @@ jobs: env: COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} - name: Checkout scoop bucket - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: cli/scoop-gh path: scoop-gh