Skip to content

Commit

Permalink
Merge pull request #638 from paketo-buildpacks/remove-debug
Browse files Browse the repository at this point in the history
Removes additional debug info
  • Loading branch information
Daniel Mikusa authored Apr 14, 2022
2 parents 9df011a + dd24556 commit 3885ddb
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions actions/draft-release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
_ "embed"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"

Expand All @@ -46,18 +45,6 @@ func main() {
panic(err)
}

cwd, err := os.Getwd()
if err != nil {
panic(err)
}
fmt.Println("CWD:", cwd)
files, err := filepath.Glob("./*")
if err != nil {
panic(err)
}
fmt.Println("Files:", files)
fmt.Println("Payload:", payload)

buf := &bytes.Buffer{}
err = drafter.BuildAndWriteReleaseDraftFromTemplate(buf, templateContents, payload)
if err != nil {
Expand All @@ -66,12 +53,9 @@ func main() {
body := buf.String()

name := payload.Release.Name
fmt.Println("PrimaryBuildpack Name:", payload.PrimaryBuildpack.Info.Name, "]")
if payload.PrimaryBuildpack.Info.Name != "" {
fmt.Println("it's not empty")
name = fmt.Sprintf("%s %s", payload.PrimaryBuildpack.Info.Name, payload.Release.Name)
}
fmt.Println("Name:", name)

fullRepo, found := os.LookupEnv("GITHUB_REPOSITORY")
if !found {
Expand All @@ -90,8 +74,6 @@ func main() {
Name: &name,
Body: &body,
}
fmt.Println("owner:", owner, "repo:", repo, "releaseId:", releaseId)
fmt.Println("repoRelease:", repoRelease)

if _, dryRun := inputs["dry_run"]; dryRun {
fmt.Println("Title:", name)
Expand All @@ -103,12 +85,12 @@ func main() {
fmt.Println(" ", repoRelease)
} else {
var c *http.Client
if s, ok := inputs["token"]; ok {
if s, ok := inputs["github_token"]; ok {
c = oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(&oauth2.Token{AccessToken: s}))
}
gh := github.NewClient(c)

rel, resp, err := gh.Repositories.EditRelease(
_, _, err := gh.Repositories.EditRelease(
context.Background(),
owner,
repo,
Expand All @@ -117,9 +99,5 @@ func main() {
if err != nil {
panic(fmt.Errorf("unable to execute EditRelease %s/%s/%d with %q\n%w", owner, repo, releaseId, repoRelease, err))
}

fmt.Println("rel:", rel)
fmt.Println("resp:", resp)
fmt.Println("status:", resp.StatusCode)
}
}

0 comments on commit 3885ddb

Please sign in to comment.