Commit-Insights is a tool that provides insights into your codebase by analyzing Git commit history and harnessing data. It's designed to work as a plugin in your CI/CD pipeline.
- Gather commit history between two Git SHAs
- Extract and process commit metadata
- Extract file change information from each commit
- Output data in a structured format for further analysis
- Go 1.16+
- Git
-
Clone the repository
git clone https://github.com/diegopereiraeng/commit-insights.git
-
Navigate to the project directory
cd commit-insights
-
Download the Go modules required for the project.
go mod download
-
Build the project to generate the binary.
go build -o commit-insights
You can run the tool using the following command as an example:
./commit-insights --acc_id=<YOUR_ACCOUNT_ID> --orgID=default --projectID=GIT_FLOW_DEMO --pipelineID=Plugin_Factory --stageID=Build_Golang --statusList=Success --repoName=commit-insights --branch=main --buildType=branch --ingestionType=pipeline --harness_secret=<YOUR_HARNESS_READ_TOKEN>
Here is a sample example of how you can use the Commit-Insights in a pipeline:
```yaml
- step: type: Plugin name: Commit-Insights identifier: CommitInsights spec: connectorRef: account.DockerHubDiego image: diegokoala/commit-insights:latest settings: harness_secret: <+secrets.getValue("harnesssatokenplugin")> imagePullPolicy: Always ```
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request