|
| 1 | +# CodeAnt CI Scan Action |
| 2 | + |
| 3 | +A GitHub Action to run CodeAnt CI security and code quality analysis on your repository. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🛡️ Automated security and code quality scanning |
| 8 | +- 🔍 Deep code analysis and vulnerability detection |
| 9 | +- 📊 Detailed reports and insights |
| 10 | +- ⚡ Fast and easy integration |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +### Basic Usage |
| 15 | + |
| 16 | +Add this action to your workflow: |
| 17 | + |
| 18 | +```yaml |
| 19 | +name: CodeAnt CI Scan |
| 20 | + |
| 21 | +on: |
| 22 | + push: |
| 23 | + branches: [ "main" ] |
| 24 | + pull_request: |
| 25 | + branches: [ "main" ] |
| 26 | + |
| 27 | +jobs: |
| 28 | + codeant_scan: |
| 29 | + name: Run CodeAnt CI scan |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - name: Checkout code |
| 33 | + uses: actions/checkout@v3 |
| 34 | + |
| 35 | + - name: Run CodeAnt CI Scan |
| 36 | + uses: CodeAnt-AI/codeant-ci-scan-action@v0.0.1 |
| 37 | + with: |
| 38 | + access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }} |
| 39 | +``` |
| 40 | +
|
| 41 | +### Advanced Usage |
| 42 | +
|
| 43 | +Customize the scan with additional options: |
| 44 | +
|
| 45 | +```yaml |
| 46 | +- name: Run CodeAnt CI Scan |
| 47 | + uses: CodeAnt-AI/codeant-ci-scan-action@v0.0.1 |
| 48 | + with: |
| 49 | + access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }} |
| 50 | + api_base: 'https://api.codeant.ai' |
| 51 | + include_paths: 'src/,lib/' |
| 52 | + exclude_paths: 'test/,docs/' |
| 53 | +``` |
| 54 | +
|
| 55 | +## Inputs |
| 56 | +
|
| 57 | +| Input | Description | Required | Default | |
| 58 | +|-------|-------------|----------|---------| |
| 59 | +| `access_token` | CodeAnt access token (PAT or repository token) | Yes | - | |
| 60 | +| `api_base` | CodeAnt API base URL | No | `https://api.codeant.ai` | |
| 61 | +| `include_paths` | Comma-separated paths to include in scan | No | `''` (all files) | |
| 62 | +| `exclude_paths` | Comma-separated paths to exclude from scan | No | `''` (none) | |
| 63 | + |
| 64 | +## Setup |
| 65 | + |
| 66 | +### 1. Get Your CodeAnt Access Token |
| 67 | + |
| 68 | +1. Sign up or log in to [CodeAnt](https://codeant.ai) |
| 69 | +2. Navigate to your account settings |
| 70 | +3. Generate a new access token |
| 71 | +4. Copy the token |
| 72 | + |
| 73 | +### 2. Add Token to GitHub Secrets |
| 74 | + |
| 75 | +1. Go to your repository's Settings |
| 76 | +2. Navigate to Secrets and variables → Actions |
| 77 | +3. Click "New repository secret" |
| 78 | +4. Name: `CODEANT_ACCESS_TOKEN` |
| 79 | +5. Value: Paste your CodeAnt access token |
| 80 | +6. Click "Add secret" |
| 81 | + |
| 82 | +### 3. Create Workflow File |
| 83 | + |
| 84 | +Create `.github/workflows/codeant-scan.yml` in your repository with the usage example above. |
| 85 | + |
| 86 | +## Supported Events |
| 87 | + |
| 88 | +This action works with any GitHub event that provides commit information: |
| 89 | + |
| 90 | +- `push` |
| 91 | +- `pull_request` |
| 92 | +- `workflow_dispatch` |
| 93 | +- `schedule` |
| 94 | + |
| 95 | +## Example Workflows |
| 96 | + |
| 97 | +### Scan on Push and Pull Request |
| 98 | + |
| 99 | +```yaml |
| 100 | +name: CodeAnt CI Scan |
| 101 | +
|
| 102 | +on: |
| 103 | + push: |
| 104 | + branches: [ "main", "develop" ] |
| 105 | + pull_request: |
| 106 | + branches: [ "main" ] |
| 107 | +
|
| 108 | +jobs: |
| 109 | + codeant_scan: |
| 110 | + runs-on: ubuntu-latest |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@v3 |
| 113 | + - uses: CodeAnt-AI/codeant-ci-scan-action@v0.0.1 |
| 114 | + with: |
| 115 | + access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }} |
| 116 | +``` |
| 117 | + |
| 118 | +### Scheduled Daily Scan |
| 119 | + |
| 120 | +```yaml |
| 121 | +name: Daily CodeAnt Scan |
| 122 | +
|
| 123 | +on: |
| 124 | + schedule: |
| 125 | + - cron: '0 2 * * *' # Run at 2 AM UTC daily |
| 126 | +
|
| 127 | +jobs: |
| 128 | + codeant_scan: |
| 129 | + runs-on: ubuntu-latest |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v3 |
| 132 | + - uses: CodeAnt-AI/codeant-ci-scan-action@v0.0.1 |
| 133 | + with: |
| 134 | + access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }} |
| 135 | +``` |
| 136 | + |
| 137 | +### Scan Specific Directories |
| 138 | + |
| 139 | +```yaml |
| 140 | +- uses: CodeAnt-AI/codeant-ci-scan-action@v0.0.1 |
| 141 | + with: |
| 142 | + access_token: ${{ secrets.CODEANT_ACCESS_TOKEN }} |
| 143 | + include_paths: 'src/,backend/' |
| 144 | + exclude_paths: 'src/tests/,backend/vendor/' |
| 145 | +``` |
| 146 | + |
| 147 | +## Troubleshooting |
| 148 | + |
| 149 | +### Authentication Errors |
| 150 | + |
| 151 | +- Ensure your `CODEANT_ACCESS_TOKEN` is correctly set in repository secrets |
| 152 | +- Verify the token hasn't expired |
| 153 | +- Check that the token has the necessary permissions |
| 154 | + |
| 155 | +### Scan Failures |
| 156 | + |
| 157 | +- Verify your repository is accessible |
| 158 | +- Check that the API base URL is correct |
| 159 | +- Review the action logs for specific error messages |
| 160 | + |
| 161 | +## Support |
| 162 | + |
| 163 | +- 📧 Email: support@codeant.ai |
| 164 | +- 📚 Documentation: [https://docs.codeant.ai](https://docs.codeant.ai) |
| 165 | +- 🐛 Issues: [GitHub Issues](https://github.com/CodeAnt-AI/codeant-ci-scan-action/issues) |
| 166 | + |
| 167 | +## License |
| 168 | + |
| 169 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 170 | + |
| 171 | +## About CodeAnt |
| 172 | + |
| 173 | +CodeAnt provides automated code analysis and security scanning to help developers build secure, high-quality software. Visit [codeant.ai](https://codeant.ai) to learn more. |
0 commit comments