diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..6009858 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,13 @@ +Raystack takes the security of our software products and services seriously. + +If you believe you have found a security vulnerability in this project, you can report it to us directly using [private vulnerability reporting][]. + +- Include a description of your investigation of this project's codebase and why you believe an exploit is possible. +- POCs and links to code are greatly encouraged. +- Such reports are not eligible for a bounty reward. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Thanks for helping make GitHub safe for everyone. + +[private vulnerability reporting]: https://github.com/raystack/meteor/security/advisories \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..5cef9d4 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,29 @@ +name: Lint +on: + push: + paths: + - "**.go" + - go.mod + - go.sum + pull_request: + paths: + - "**.go" + - go.mod + - go.sum + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Run linter + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..4be296a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,22 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Run unit tests + run: make test diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml deleted file mode 100644 index d655ccb..0000000 --- a/.github/workflows/verify.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: verify - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.20" - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Run linter - uses: golangci/golangci-lint-action@v3 - with: - version: v1.53 - test: - runs-on: ubuntu-latest - steps: - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: "1.20" - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Run unit tests - run: make test diff --git a/term/brew.go b/term/brew.go index 45826c0..fa73adc 100644 --- a/term/brew.go +++ b/term/brew.go @@ -6,9 +6,18 @@ import ( "strings" ) -// IsUnderHomebrew checks whether the given binary is under the homebrew path. -func IsUnderHomebrew(binpath string) bool { - if binpath == "" { +// IsUnderHomebrew checks if a given binary path is managed under the Homebrew path. +// +// This function is useful to verify if a binary is installed via Homebrew +// by comparing its location to the Homebrew binary directory. +// +// Parameters: +// - path: The path of the binary to check. +// +// Returns: +// - A boolean value indicating whether the binary is located under the Homebrew path. +func IsUnderHomebrew(path string) bool { + if path == "" { return false } @@ -23,10 +32,17 @@ func IsUnderHomebrew(binpath string) bool { } brewBinPrefix := filepath.Join(strings.TrimSpace(string(brewPrefixBytes)), "bin") + string(filepath.Separator) - return strings.HasPrefix(binpath, brewBinPrefix) + return strings.HasPrefix(path, brewBinPrefix) } -// HasHomebrew check whether the user has installed brew +// HasHomebrew checks if Homebrew is installed on the user's system. +// +// This function determines the presence of Homebrew by looking for the "brew" +// executable in the system's PATH. It is useful to ensure Homebrew dependencies +// can be managed before executing related commands. +// +// Returns: +// - A boolean value indicating whether Homebrew is installed. func HasHomebrew() bool { _, err := exec.LookPath("brew") return err == nil