diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..0160c13 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,4 @@ +{ + "useGitignore": true, + "words": [] +} diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 0000000..ad871b7 --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,27 @@ +name: CSpell AI assistant + +on: + pull_request: + branches: + - main + - dev + workflow_dispatch: + +jobs: + cspell-ai-check: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + id-token: write # Дозволяємо генерацію OIDC токена + steps: + - name: Request AI CSpell Analysis + run: | + # Отримуємо OIDC токен через внутрішній API GitHub Actions + ID_TOKEN=$(curl -sLS "${ACTIONS_ID_TOKEN_REQUEST_URL}" -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" | jq -r '.value') + # Відправляємо запит на сервер аналізу + # Публічний URL сервера https://nitra.dev/spell-ai/ (dev) або https://7n.ai/spell-ai/ (prod) + curl -s -i -X POST "https://7n.ai/spell-ai/analyze" \ + -H "Authorization: Bearer $ID_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"repo\": \"${{ github.repository }}\", \"prNumber\": ${{ github.event.pull_request.number }}}" diff --git a/package.json b/package.json index 814b342..7f550fb 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ }, "homepage": "https://github.com/nitra/smsc#readme", "devDependencies": { + "@cspell/dict-uk-ua": "^4.0.6", + "@nitra/cspell-dict": "^1.0.186", "prettier-config-standard": "^4.0.0" }, "dependencies": {