Skip to content

Commit

Permalink
style: 💄 disable linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria committed Sep 24, 2024
1 parent c4be76b commit 078014d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/environment/createPR.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,41 @@ import (

func createPR(description, namespace string) func(github.GithubIface, []string) (string, error) {
b := make([]byte, 2)
rand.Read(b)
_, randErr := rand.Read(b)

fourCharUid := hex.EncodeToString(b)
branchName := namespace + "-rds-minor-version-bump-" + fourCharUid

return func(gh github.GithubIface, filenames []string) (string, error) {
if randErr != nil {
return "", randErr
}

checkCmd := exec.Command("/bin/sh", "-c", "git checkout -b "+branchName)
//nolint:staticcheck
checkCmd.Start()
//nolint:staticcheck
checkCmd.Wait()

strFiles := strings.Join(filenames, " ")
cmd := exec.Command("/bin/sh", "-c", "git add "+strFiles)
cmd.Dir = "namespaces/live.cloud-platform.service.justice.gov.uk/" + namespace + "/resources"
//nolint:staticcheck
cmd.Start()
//nolint:staticcheck
cmd.Wait()

commitCmd := exec.Command("/bin/sh", "-c", "git commit -m 'concourse: correcting rds version drift'")
commitCmd.Dir = "namespaces/live.cloud-platform.service.justice.gov.uk/" + namespace + "/resources"
//nolint:staticcheck
commitCmd.Start()
//nolint:staticcheck
commitCmd.Wait()

pushCmd := exec.Command("/bin/sh", "-c", "git push --set-upstream origin "+branchName)
//nolint:staticcheck
pushCmd.Start()
//nolint:staticcheck
pushCmd.Wait()

return gh.CreatePR(branchName, namespace, description)
Expand Down

0 comments on commit 078014d

Please sign in to comment.