Skip to content

Commit

Permalink
Merge pull request #9 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao authored Aug 24, 2023
2 parents 150748f + cd67bb4 commit 61a2f32
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/pr-auto-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ jobs:
with:
github-token: ${{ secrets.PAT_FOR_RELEASE_TAGGER }}
script: |
const { data: { tag_name: lastRelease } } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
let lastRelease = 'v0.0.0'
try {
const { data: { tag_name: lastRelease } } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
} catch (e) {
console.log('No release found, creating first release')
}
const nextRelease = lastRelease.replace(/(\d+)$/, (match, p1) => Number(p1) + 1)
const prTitle = `Release ${nextRelease}`
const pr = await github.rest.pulls.create({
Expand Down
14 changes: 6 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/joho/godotenv v1.5.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/machinebox/graphql v0.2.2
github.com/oklog/ulid/v2 v2.1.0
github.com/pkg/errors v0.9.1
github.com/resendlabs/resend-go v1.7.0
github.com/rs/zerolog v1.30.0
Expand All @@ -22,14 +23,12 @@ require (
github.com/urfave/cli/v2 v2.25.7
github.com/vektah/gqlparser/v2 v2.5.8
go.uber.org/fx v1.20.0
golang.org/x/crypto v0.9.0
golang.org/x/crypto v0.12.0
gopkg.in/guregu/null.v3 v3.5.0
gopkg.in/guregu/null.v4 v4.0.0
)

require (
github.com/matryer/is v1.4.1 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
)
require github.com/matryer/is v1.4.1 // indirect

require (
github.com/agnivade/levenshtein v1.1.1 // indirect
Expand Down Expand Up @@ -59,10 +58,9 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gopkg.in/guregu/null.v4 v4.0.0
gopkg.in/yaml.v3 v3.0.1 // indirect
mellium.im/sasl v0.3.1 // indirect
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY=
go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
Expand All @@ -140,8 +142,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/0module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package controller
import "go.uber.org/fx"

func Module() fx.Option {
return fx.Module("controller", fx.Invoke(RegisterGraphQL))
return fx.Module("controller", fx.Invoke(RegisterGraphQL), fx.Invoke(RegisterMeta))
}
18 changes: 18 additions & 0 deletions internal/controller/meta.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package controller

import (
"github.com/gofiber/fiber/v2"
"go.uber.org/fx"
)

type Meta struct {
fx.In

Route fiber.Router `name:"internal"`
}

func RegisterMeta(c GraphQL) {
c.Route.Get("/ping", func(c *fiber.Ctx) error {
return c.SendString("pong")
})
}

0 comments on commit 61a2f32

Please sign in to comment.