-
Notifications
You must be signed in to change notification settings - Fork 0
[REVIEW] CODERABBIT REVIEW #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: review-base
Are you sure you want to change the base?
Changes from all commits
6a5c5df
b989729
88c9d6d
afa59e3
3a1aad1
cc5ad5d
818e8a4
0e9527f
860e5c0
c864a08
edbe9a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: release-main | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Build and publish release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Select next version | ||
| id: version | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| git fetch --force --tags | ||
|
|
||
| latest_tag="$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n 1 || true)" | ||
| if [[ -z "${latest_tag}" ]]; then | ||
| latest_tag="v0.0.0" | ||
| fi | ||
|
|
||
| bump="patch" | ||
| if [[ -f ".release-bump" ]]; then | ||
| bump="$(tr '[:upper:]' '[:lower:]' < .release-bump | tr -d '[:space:]')" | ||
| elif [[ "${latest_tag}" == "v0.0.0" ]]; then | ||
| bump="minor" | ||
| else | ||
| changed_files="$(git diff --name-status "${latest_tag}"..HEAD)" | ||
| added_go_files="$(printf '%s\n' "${changed_files}" | awk '$1 == "A" && $2 ~ /\.go$/ { print $2 }')" | ||
| dependency_changes="$(printf '%s\n' "${changed_files}" | awk '$2 == "go.mod" || $2 == "go.sum" { print $2 }')" | ||
|
|
||
| if [[ -n "${added_go_files}" || -n "${dependency_changes}" ]]; then | ||
| bump="minor" | ||
| fi | ||
| fi | ||
|
|
||
| case "${bump}" in | ||
| major|minor|patch) ;; | ||
| *) | ||
| echo "::error::.release-bump must contain major, minor, or patch." | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| version="${latest_tag#v}" | ||
| IFS='.' read -r major minor patch <<< "${version}" | ||
|
|
||
| case "${bump}" in | ||
| major) | ||
| major=$((major + 1)) | ||
| minor=0 | ||
| patch=0 | ||
| ;; | ||
| minor) | ||
| minor=$((minor + 1)) | ||
| patch=0 | ||
| ;; | ||
| patch) | ||
| patch=$((patch + 1)) | ||
| ;; | ||
| esac | ||
|
|
||
| next_tag="v${major}.${minor}.${patch}" | ||
|
|
||
| if git rev-parse "${next_tag}" >/dev/null 2>&1; then | ||
| echo "::error::Tag ${next_tag} already exists." | ||
| exit 1 | ||
| fi | ||
|
|
||
| { | ||
| echo "latest_tag=${latest_tag}" | ||
| echo "bump=${bump}" | ||
| echo "next_tag=${next_tag}" | ||
| } >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Create release notes | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| latest_tag="${{ steps.version.outputs.latest_tag }}" | ||
| next_tag="${{ steps.version.outputs.next_tag }}" | ||
| bump="${{ steps.version.outputs.bump }}" | ||
|
|
||
| mkdir -p dist | ||
|
|
||
| { | ||
| echo "## ${next_tag}" | ||
| echo | ||
| echo "Release type: ${bump}" | ||
| echo | ||
|
|
||
| echo "### Commits" | ||
| if [[ "${latest_tag}" == "v0.0.0" ]]; then | ||
| git log --oneline --no-merges | ||
| else | ||
| git log --oneline --no-merges "${latest_tag}"..HEAD | ||
| fi | ||
| echo | ||
|
|
||
| echo "### Changed files" | ||
| if [[ "${latest_tag}" == "v0.0.0" ]]; then | ||
| git ls-tree -r --name-only HEAD | sed 's/^/A\t/' | ||
| else | ||
| git diff --name-status "${latest_tag}"..HEAD | ||
| fi | ||
| } > dist/release-notes.md | ||
|
|
||
| - name: Create tag | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| next_tag="${{ steps.version.outputs.next_tag }}" | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git tag -a "${next_tag}" -m "Release ${next_tag}" | ||
| git push origin "${next_tag}" | ||
|
|
||
| - name: Release | ||
| uses: goreleaser/goreleaser-action@v7 | ||
| with: | ||
| distribution: goreleaser | ||
| version: "~> v2" | ||
| args: release --clean --release-notes=dist/release-notes.md | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bin/* |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,63 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| project_name: malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| before: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hooks: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - go mod tidy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Consider adding test execution to before hooks. The 🧪 Suggested test hook before:
hooks:
- go mod tidy
+ - go test ./...🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| builds: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - id: malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| main: ./cmd/malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| binary: malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - CGO_ENABLED=0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| goos: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - darwin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - linux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - windows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| goarch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - amd64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - arm64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ldflags: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - -s -w | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - -X main.version={{ .Version }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - -X main.commit={{ .Commit }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - -X main.buildDate={{ .Date }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archives: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - id: malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| formats: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - tar.gz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| format_overrides: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - goos: windows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| formats: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - zip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checksum: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name_template: checksums.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| snapshot: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version_template: "{{ incpatch .Version }}-next" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| changelog: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disable: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| brews: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ids: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - malox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repository: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| owner: darckorp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: homebrew-tap | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branch: main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| directory: Formula | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| homepage: "https://github.com/darckorp/malox" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Fast cross-platform terminal security scanner for open source projects" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| license: "MIT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| install: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bin.install "malox" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| system "#{bin}/malox", "--version" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+47
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Repository owner and homepage mismatch. The Homebrew configuration uses
This mismatch will cause the formula to be published to the wrong repository and the homepage link to be incorrect. 🔧 Proposed fix brews:
- name: malox
ids:
- malox
repository:
- owner: darckorp
+ owner: Kawixh
name: homebrew-tap
branch: main
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
directory: Formula
- homepage: "https://github.com/darckorp/malox"
+ homepage: "https://github.com/Kawixh/malox"
description: "Fast cross-platform terminal security scanner for open source projects"
license: "MIT"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Add test execution before releasing.
The workflow builds and publishes releases but does not run tests. As per coding guidelines,
go testshould run before release to ensure code quality.🧪 Suggested test step
Add a test step after "Set up Go" and before "Select next version":
- name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true + - name: Run tests + run: go test -v ./... + - name: Select next version id: version🤖 Prompt for AI Agents
Source: Coding guidelines