diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 34d4630..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Bug Report -description: File a bug report to help us improve -title: "[Bug]: " -labels: ["bug", "needs-triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - - type: textarea - id: description - attributes: - label: Bug Description - description: A clear and concise description of what the bug is. - placeholder: Tell us what happened - validations: - required: true - - - type: textarea - id: steps - attributes: - label: Steps to Reproduce - description: Steps to reproduce the behavior - placeholder: | - 1. Go to '...' - 2. Click on '....' - 3. Enter cron expression '...' - 4. See error - validations: - required: true - - - type: textarea - id: expected - attributes: - label: Expected Behavior - description: What did you expect to happen? - placeholder: I expected... - validations: - required: true - - - type: textarea - id: actual - attributes: - label: Actual Behavior - description: What actually happened? - placeholder: Instead... - validations: - required: true - - - type: input - id: version - attributes: - label: Version - description: What version of git-context are you running? - placeholder: v1.0.0 or commit hash - validations: - required: true - - - type: dropdown - id: os - attributes: - label: Operating System - description: What OS are you using? - options: - - macOS - - Linux - - Windows - - Other - validations: - required: true - - - type: input - id: terminal - attributes: - label: Terminal - description: What terminal emulator are you using? - placeholder: e.g., iTerm2, Terminal.app, Alacritty, etc. - - - type: textarea - id: logs - attributes: - label: Logs - description: Please copy and paste any relevant log output or error messages - render: shell - - - type: textarea - id: context - attributes: - label: Additional Context - description: Add any other context about the problem here - placeholder: Screenshots, GIFs, or additional information diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index e01f6ae..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Discussions - url: https://github.com/techquestsdev/git-context/discussions - about: Ask questions and discuss ideas with the community - - name: Documentation - url: https://github.com/techquestsdev/git-context#readme - about: Read the documentation for help and examples diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 1c65715..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Feature Request -description: Suggest an idea for this project -title: "[Feature]: " -labels: ["enhancement", "needs-triage"] -body: - - type: markdown - attributes: - value: | - Thanks for suggesting a new feature! - - - type: textarea - id: problem - attributes: - label: Problem Statement - description: Is your feature request related to a problem? Please describe. - placeholder: I'm frustrated when... - validations: - required: true - - - type: textarea - id: solution - attributes: - label: Proposed Solution - description: Describe the solution you'd like - placeholder: I would like to see... - validations: - required: true - - - type: textarea - id: alternatives - attributes: - label: Alternatives Considered - description: Describe alternatives you've considered - placeholder: I also thought about... - - - type: textarea - id: examples - attributes: - label: Examples - description: Provide examples of how this feature would be used - placeholder: | - Example 1: ... - Example 2: ... - - - type: dropdown - id: priority - attributes: - label: Priority - description: How important is this feature to you? - options: - - Nice to have - - Important - - Critical - validations: - required: true - - - type: checkboxes - id: contribution - attributes: - label: Contribution - description: Would you be willing to contribute this feature? - options: - - label: I am willing to submit a PR for this feature - required: false - - - type: textarea - id: context - attributes: - label: Additional Context - description: Add any other context, screenshots, or mockups about the feature request here diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f297a9f..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,61 +0,0 @@ -# Pull Request - -## Description - - -## Type of Change - - -- [ ] 🐛 Bug fix (non-breaking change which fixes an issue) -- [ ] ✨ New feature (non-breaking change which adds functionality) -- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] 📝 Documentation update -- [ ] 🎨 Code style update (formatting, renaming) -- [ ] ♻️ Code refactoring (no functional changes) -- [ ] ⚡ Performance improvement -- [ ] ✅ Test update -- [ ] 🔧 Build/CI configuration change -- [ ] 🔒 Security fix - -## Related Issues - -Fixes #(issue number) -Related to #(issue number) - -## Changes Made - - -- -- -- - -## Testing - - -- [ ] Existing tests pass (`make test`) -- [ ] New tests added (if applicable) -- [ ] Manual testing performed -- [ ] Linter passes (`make lint`) - -### Test Coverage - -- Current coverage: __% -- Coverage change: __% (increase/decrease) - -## Screenshots/Recordings - - -## Checklist - - -- [ ] My code follows the project's style guidelines -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published - -## Additional Notes - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f98830..90a9c34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,122 +5,17 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: permissions: contents: read security-events: write -jobs: - test: - name: Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - go: ["1.25"] - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: ${{ matrix.go }} - - - name: Cache Go modules - uses: actions/cache@v6 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', '**/go.mod') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Download dependencies - run: go mod download - - - name: Verify dependencies - run: go mod verify - - - name: Run tests - shell: bash - run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... - - - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v7 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: "1.25" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true - - name: golangci-lint - uses: golangci/golangci-lint-action@v9 - with: - version: latest - args: --timeout=5m - - build: - name: Build - runs-on: ${{ matrix.os }} - needs: [test, lint, security] - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: "1.25" - - - name: Build - run: go build -v -o bin/git-context${{ matrix.os == 'windows-latest' && '.exe' || '' }} . - - - name: Upload artifact - uses: actions/upload-artifact@v7 - with: - name: git-context-${{ matrix.os }} - path: bin/git-context${{ matrix.os == 'windows-latest' && '.exe' || '' }} - retention-days: 7 - - security: - name: Security Scan - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: "1.25" - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - scan-type: "fs" - scan-ref: "." - format: "sarif" - output: "trivy-results.sarif" - severity: "CRITICAL,HIGH,MEDIUM" - exit-code: "1" - - - name: Upload Trivy results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v4.37.4 - if: always() - with: - sarif_file: "trivy-results.sarif" +jobs: + ci: + uses: techquestsdev/.github/.github/workflows/go-ci.yml@main + secrets: inherit diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..dda575c --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,13 @@ +name: Dependency Review + +on: + pull_request: + branches: [main] + +permissions: + contents: read + pull-requests: write + +jobs: + dependency-review: + uses: techquestsdev/.github/.github/workflows/dependency-review.yml@main diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..948fb48 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,18 @@ +name: Sync Labels + +on: + push: + branches: [main] + paths: + - ".github/workflows/labels.yml" + workflow_dispatch: + schedule: + - cron: "0 6 * * 1" + +permissions: + contents: read + issues: write + +jobs: + labels: + uses: techquestsdev/.github/.github/workflows/sync-labels.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2662ad4..8632817 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,36 +2,18 @@ name: Release on: push: - tags: - - "v*" + branches: [main] + workflow_dispatch: permissions: contents: write +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + jobs: release: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version: "1.25" - - - name: Run tests - run: go test -v -race ./... - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v7 - with: - distribution: goreleaser - version: v2 - args: release --clean - env: - HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: techquestsdev/.github/.github/workflows/go-release.yml@main + secrets: + HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }} diff --git a/.golangci.yml b/.golangci.yml index b2219d9..6cdd20d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,7 +14,9 @@ linters: default: all disable: - wsl # Deprecated, using wsl_v5 instead - - exhaustruct # Disabled due to excessive noise + - gomodguard # Deprecated, using gomodguard_v2 instead + - exhaustruct # Deprecated, replaced by exhaustruct_v5 + - exhaustruct_v5 # Disabled due to excessive noise - noinlineerr # Disabled to allow error wrapping without inlining - testpackage # Tests need access to unexported functions - gochecknoglobals # Cobra commands need to be global diff --git a/.goreleaser.yml b/.goreleaser.yml index 2700cc1..30b8c71 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,13 +1,10 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json # GoReleaser configuration for Git Context -# A powerful CLI tool for managing multiple Git configuration profiles -# Keywords: git, configuration, profiles, CLI, developer-tools, Go -# Documentation: https://goreleaser.com project_name: git-context version: 2 -# Metadata for the project metadata: mod_timestamp: "{{ .CommitTimestamp }}" @@ -44,7 +41,8 @@ builds: archives: - id: default - format: tar.gz + formats: + - tar.gz name_template: >- {{ .ProjectName }}_ {{- .Version }}_ @@ -55,7 +53,8 @@ archives: {{- if .Arm }}v{{ .Arm }}{{ end }} format_overrides: - goos: windows - format: zip + formats: + - zip files: - README.md - LICENSE @@ -64,7 +63,7 @@ checksum: name_template: "checksums.txt" snapshot: - name_template: "{{ incpatch .Version }}-next" + version_template: "{{ incpatch .Version }}-next" changelog: sort: asc @@ -87,21 +86,33 @@ changelog: - title: Others order: 999 -brews: - - repository: - owner: techquestsdev - name: homebrew-tap - token: "{{ .Env.HOMEBREW_TOKEN }}" - name: git-context +homebrew_casks: + - name: git-context + directory: Casks homepage: https://github.com/techquestsdev/git-context description: "A powerful CLI tool for managing multiple Git configuration profiles" license: MIT + binaries: + - git-context skip_upload: auto - # Keywords for Homebrew discoverability + repository: + owner: techquestsdev + name: homebrew-tap + branch: main + token: "{{ .Env.HOMEBREW_TOKEN }}" + commit_author: + name: github-actions[bot] + email: github-actions[bot]@users.noreply.github.com + commit_msg_template: "Brew cask update for {{ .ProjectName }} version {{ .Tag }}" caveats: | Git Context is a command-line tool for managing multiple Git configuration profiles. Switch between different Git identities (work, personal, school, etc.) with a single command. - Keywords: git, configuration, profiles, CLI, developer-tools, identity-management + hooks: + post: + install_steps: | + on_macos do + run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}/git-context"] + end release: github: diff --git a/go.mod b/go.mod index 0c29faf..d0fc57f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/techquestsdev/git-context -go 1.25.0 +go 1.26.0 require ( github.com/cockroachdb/errors v1.14.0 @@ -24,6 +24,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/spf13/pflag v1.0.10 // indirect - golang.org/x/sys v0.42.0 // indirect - golang.org/x/text v0.35.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/text v0.44.0 // indirect ) diff --git a/go.sum b/go.sum index b35f74d..0e451cd 100644 --- a/go.sum +++ b/go.sum @@ -82,12 +82,12 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=