diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..64bb0f8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# CM-010. GitHub does not require CODEOWNER review (require_codeowner_review: false). +* @keyskey diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8938f5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: CI +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.26.4' + cache: true + - run: make test diff --git a/kao.local.yaml b/kao.local.yaml index 12d4ab2..e6f5225 100644 --- a/kao.local.yaml +++ b/kao.local.yaml @@ -2,7 +2,7 @@ # Usage: # docker compose up -d # make migrate -# export GITHUB_TOKEN=ghp_... +# export GITHUB_TOKEN=$(gh auth token) # export DATABASE_URL='postgres://kao:kao@localhost:5432/kao?sslmode=disable' # make build && ./bin/kao run daily --config kao.local.yaml --date 2026-06-05 @@ -39,8 +39,8 @@ controls: repo_control: branch_protection: enabled: true - required_reviews: 1 - require_codeowner_review: true + required_reviews: 0 + require_codeowner_review: false allow_force_push: false allow_branch_deletion: false codeowners: diff --git a/testdata/repo_control.jsonl b/testdata/repo_control.jsonl index 5a2341f..2873cfa 100644 --- a/testdata/repo_control.jsonl +++ b/testdata/repo_control.jsonl @@ -1 +1 @@ -{"schema_version":"v1","type":"repo_control","provider":"github","repository":"kao","default_branch":"main","branch_protection":{"enabled":true,"required_reviews":1,"require_codeowner_review":true,"allow_force_push":false,"allow_branch_deletion":false},"codeowners":{"exists":true,"path":".github/CODEOWNERS","rules":[{"pattern":"*","owners":[{"type":"user","name":"@alice","resolved_users":["alice"]}]}]},"collected_at":"2026-06-06T00:00:00Z"} +{"schema_version":"v1","type":"repo_control","provider":"github","repository":"kao","default_branch":"main","branch_protection":{"enabled":true,"required_reviews":0,"require_codeowner_review":false,"allow_force_push":false,"allow_branch_deletion":false},"codeowners":{"exists":true,"path":".github/CODEOWNERS","rules":[{"pattern":"*","owners":[{"type":"user","name":"@keyskey","resolved_users":["keyskey"]}]}]},"collected_at":"2026-06-06T00:00:00Z"}