Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a6f7bca
feat: add comprehensive dependency security scanning (closes #79)
Nov 15, 2025
848f845
fix: address PR review comments - env vars for severity, robust SARIF…
Nov 15, 2025
0e85efd
fix: resolve security workflow and Windows test failures
Nov 16, 2025
2451aec
feat: add official GitHub Action for SQL validation (closes #73)
Nov 15, 2025
3bec7f8
fix: address critical security issues - update Go version, pin depend…
Nov 15, 2025
baf4fbc
fix: resolve GitHub Action test failures caused by security fixes
ajitpratap0 Nov 16, 2025
c8e4194
fix: handle empty SARIF results without failing security workflows
Nov 16, 2025
7856df8
fix: resolve security workflow failures in GoSec and GovulnCheck
Nov 16, 2025
da8eead
fix: resolve GoSec security vulnerabilities (G304, G601, G306, G104)
Nov 16, 2025
8c90ff5
fix: resolve all remaining G601 memory aliasing issues in ast.go
Nov 16, 2025
2dff004
fix: resolve final G601 issue in CreateIndexStatement.Children()
Nov 16, 2025
3361ea6
fix: resolve all remaining G601 issues in sql_formatter.go
Nov 16, 2025
0531c33
fix: resolve all G601 issues in test files
Nov 16, 2025
02d7b75
fix: resolve glob pattern handling for nested directories in GitHub A…
Nov 16, 2025
9bc3cc1
fix: handle non-existent directories gracefully in glob pattern matching
Nov 16, 2025
1190fb3
Merge remote-tracking branch 'origin/main' into feat/security-scannin…
Nov 16, 2025
0f76c1b
fix: resolve G601 violations in extract.go and add semicolon support
Nov 16, 2025
4324b1c
fix: populate Query field in AnalysisReport to fix test failures
Nov 16, 2025
f1169e7
fix: build GoSQLX from source when testing in repository
Nov 16, 2025
3b8531b
fix: invalidate cache on each commit to force source build
Nov 16, 2025
32af31e
fix: use GITHUB_WORKSPACE and $HOME for proper path resolution
Nov 16, 2025
8b93d9c
fix: disable cache to always build from source during testing
Nov 16, 2025
8d739ee
fix: use token.SEMICOLON constant instead of string comparison
Nov 16, 2025
2b75bea
fix: add boolean literal support to INSERT VALUES parsing
Nov 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
705 changes: 705 additions & 0 deletions .github/ACTION_INTEGRATION_GUIDE.md

Large diffs are not rendered by default.

191 changes: 191 additions & 0 deletions .github/ACTION_QUICK_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# GoSQLX GitHub Action - Quick Reference

## Basic Usage

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
```

## All Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `files` | string | `**/*.sql` | Glob pattern for SQL files |
| `validate` | boolean | `true` | Enable validation |
| `lint` | boolean | `false` | Enable linting |
| `format-check` | boolean | `false` | Check formatting |
| `fail-on-error` | boolean | `true` | Fail build on errors |
| `config` | string | `` | Config file path |
| `dialect` | string | `` | SQL dialect |
| `strict` | boolean | `false` | Strict mode |
| `show-stats` | boolean | `false` | Show statistics |
| `gosqlx-version` | string | `latest` | GoSQLX version |
| `working-directory` | string | `.` | Working directory |

## Common Patterns

### Validate Only

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
validate: true
```

### Validate + Format Check

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
validate: true
format-check: true
```

### Specific Dialect

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: 'queries/*.sql'
dialect: 'postgresql'
strict: true
```

### Custom Configuration

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
config: '.gosqlx.yml'
```

### Specific Directory

```yaml
- uses: ajitpratap0/GoSQLX@v1
with:
files: '*.sql'
working-directory: './migrations'
```

## File Patterns

| Pattern | Matches |
|---------|---------|
| `**/*.sql` | All SQL files recursively |
| `*.sql` | SQL files in root only |
| `queries/**/*.sql` | All SQL in queries/ |
| `{migrations,queries}/**/*.sql` | Multiple dirs |

## Outputs

Access outputs using step ID:

```yaml
- uses: ajitpratap0/GoSQLX@v1
id: validate
with:
files: '**/*.sql'

- run: echo "Validated ${{ steps.validate.outputs.validated-files }} files"
```

Available outputs:
- `validated-files` - Files validated
- `invalid-files` - Files with errors
- `formatted-files` - Files needing format
- `validation-time` - Time in milliseconds

## SQL Dialects

Supported dialects:
- `postgresql` - PostgreSQL
- `mysql` - MySQL/MariaDB
- `sqlserver` - Microsoft SQL Server
- `oracle` - Oracle Database
- `sqlite` - SQLite

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | Validation errors (if `fail-on-error: true`) |
| 1 | Format issues (if `format-check: true` and `fail-on-error: true`) |

## Performance Targets

- Validation: <10ms per typical query
- Throughput: 100+ files/second
- Total time: <2 minutes for 100 files

## Troubleshooting

### No files found
```yaml
# Use absolute pattern
files: '**/*.sql'

# Or specify working directory
working-directory: './sql'
files: '*.sql'
```

### Unexpected failures
```yaml
# Try without strict mode
strict: false

# Check specific dialect
dialect: 'postgresql'
```

### Performance issues
```yaml
# Validate only changed files
# (Use with changed-files action)
files: ${{ steps.changed.outputs.all_changed_files }}
```

## Complete Example

```yaml
name: SQL Quality Check

on: [push, pull_request]

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate SQL
uses: ajitpratap0/GoSQLX@v1
id: validate
with:
files: '**/*.sql'
validate: true
format-check: true
strict: true
show-stats: true

- name: Report
if: always()
run: |
echo "Files: ${{ steps.validate.outputs.validated-files }}"
echo "Errors: ${{ steps.validate.outputs.invalid-files }}"
echo "Time: ${{ steps.validate.outputs.validation-time }}ms"
```

## Links

- [Full Documentation](../ACTION_README.md)
- [Testing Guide](../ACTION_TESTING_GUIDE.md)
- [Publishing Guide](../MARKETPLACE_PUBLISHING.md)
- [Example Workflows](../workflows/examples/)
Loading
Loading