From 64cc441918f6677b4c2dbba11bb56b7031607124 Mon Sep 17 00:00:00 2001 From: edoardottt Date: Thu, 23 May 2024 08:51:05 +0200 Subject: [PATCH 1/2] Add Goreleaser #58 --- .github/release.yml | 17 ++++++++++++ .github/workflows/release-binary.yml | 31 +++++++++++++++++++++ .github/workflows/release-test.yml | 28 +++++++++++++++++++ .goreleaser.yaml | 41 ++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 .github/release.yml create mode 100644 .github/workflows/release-binary.yml create mode 100644 .github/workflows/release-test.yml create mode 100644 .goreleaser.yaml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..1073bdc --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + authors: + - dependabot + categories: + - title: 🎉 New Features + labels: + - "Type: Enhancement" + - title: 🐞 Bug Fixes + labels: + - "Type: Bug" + - title: 🔨 Maintenance + labels: + - "Type: Maintenance" + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml new file mode 100644 index 0000000..5f798d4 --- /dev/null +++ b/.github/workflows/release-binary.yml @@ -0,0 +1,31 @@ +name: 🎉 Release Binary + +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: "Check out code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Set up Go" + uses: actions/setup-go@v4 + with: + go-version: 1.21.x + + - name: "Create release on GitHub" + timeout-minutes: 10 + uses: goreleaser/goreleaser-action@v4 + with: + args: "release --clean" + version: latest + workdir: . + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..9286768 --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,28 @@ +name: 🔨 Release Test + +on: + pull_request: + paths: + - '**.go' + - '**.mod' + workflow_dispatch: + +jobs: + release-test: + runs-on: ubuntu-latest + steps: + - name: "Check out code" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.x + + - name: release test + uses: goreleaser/goreleaser-action@v4 + with: + args: "release --clean --snapshot" + version: latest \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..0aa7aed --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,41 @@ +release: + header: | + ## pphack {{ .Tag }} 🥳 + *The Most Advanced Client-Side Prototype Pollution Scanner* + + footer: | + If you encounter a problem, just open an [issue](https://github.com/edoardottt/pphack/issues) + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - 386 + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + - goos: windows + goarch: 'arm' + - goos: windows + goarch: 'arm64' + binary: '{{ .ProjectName }}' + main: ./cmd/pphack/ + +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}' + +checksum: + algorithm: sha256 + From debe4f767d25aaff6054ef5fa98de7442d376682 Mon Sep 17 00:00:00 2001 From: edoardottt Date: Thu, 23 May 2024 08:51:16 +0200 Subject: [PATCH 2/2] v0.0.3 --- go.mod | 5 +---- pkg/output/banner.go | 2 +- snapcraft.yaml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 2450c4f..2ecdf13 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/projectdiscovery/goflags v0.1.53 github.com/projectdiscovery/gologger v1.1.12 github.com/projectdiscovery/utils v0.0.94 + go.uber.org/ratelimit v0.3.1 ) require ( @@ -15,9 +16,6 @@ require ( github.com/tidwall/gjson v1.14.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect -) - -require ( github.com/andybalholm/brotli v1.1.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aymerick/douceur v0.2.0 // indirect @@ -49,7 +47,6 @@ require ( github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - go.uber.org/ratelimit v0.3.1 golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect diff --git a/pkg/output/banner.go b/pkg/output/banner.go index 29a903c..6b66b8d 100644 --- a/pkg/output/banner.go +++ b/pkg/output/banner.go @@ -11,7 +11,7 @@ import "github.com/projectdiscovery/gologger" var printed = false const ( - Version = "v0.0.2" + Version = "v0.0.3" banner = ` __ __ ____ ____ / /_ ____ ______/ /__ / __ \/ __ \/ __ \/ __ ` + "`" + `/ ___/ //_/ diff --git a/snapcraft.yaml b/snapcraft.yaml index 48e8dde..510b00f 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -2,7 +2,7 @@ name: pphack summary: The Most Advanced Client-Side Prototype Pollution Scanner description: | The Most Advanced Client-Side Prototype Pollution Scanner -version: 0.0.2 +version: 0.0.3 grade: stable base: core20