diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 85be8764..0ca85023 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,8 +6,8 @@ on: - main jobs: - docs: - uses: nullplatform/actions-nullplatform/.github/workflows/tf-docs.yml@main - conventional-commit: - needs: docs + branch-name: + uses: nullplatform/actions-nullplatform/.github/workflows/branch-validation.yml@main + + commitlint: uses: nullplatform/actions-nullplatform/.github/workflows/conventional-commit.yml@main diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 07d9f574..7ec383f3 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -6,5 +6,5 @@ on: - main jobs: - quality: + validate: uses: nullplatform/actions-nullplatform/.github/workflows/tofu-lint.yml@main diff --git a/.github/workflows/readme-generator.yml b/.github/workflows/readme-generator.yml index 2be4eac6..9f75a005 100644 --- a/.github/workflows/readme-generator.yml +++ b/.github/workflows/readme-generator.yml @@ -13,11 +13,12 @@ concurrency: jobs: generate-readme: - uses: nullplatform/actions-nullplatform-terraform/.github/workflows/readme-ai.yml@main + uses: nullplatform/actions-nullplatform/.github/workflows/readme-ai-v2.yml@main permissions: contents: write models: read with: - modules_base_dir: '.' + base_dir: '.' generate_all: false + ai_provider: 'openai' ai_model: 'gpt-4o' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d5b30c9..907d58db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,4 +14,4 @@ jobs: uses: nullplatform/actions-nullplatform/.github/workflows/release.yml@main permissions: contents: write - pull-requests: write \ No newline at end of file + pull-requests: write diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index c11ecbaa..b651fb34 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -9,7 +9,8 @@ on: jobs: tfsec: - uses: nullplatform/actions-nullplatform-terraform/.github/workflows/tfsec.yml@main + uses: nullplatform/actions-nullplatform/.github/workflows/tfsec.yml@main + continue-on-error: true permissions: contents: read pull-requests: write diff --git a/.husky/pre-commit b/.husky/pre-commit index 18c67d05..c061e30d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,7 +2,7 @@ # Validate branch name BRANCH=$(git rev-parse --abbrev-ref HEAD) -PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)/.+$" +PATTERN="^(feat|feature|fix|docs|style|refactor|perf|test|build|ci|chore|revert)/.+$" if [ "$BRANCH" != "main" ] && ! echo "$BRANCH" | grep -Eq "$PATTERN"; then echo "Invalid branch name: $BRANCH" @@ -10,6 +10,6 @@ if [ "$BRANCH" != "main" ] && ! echo "$BRANCH" | grep -Eq "$PATTERN"; then echo "Branch name must follow the pattern: type/description" echo " Examples: feat/add-login, fix/bug-123, docs/readme" echo "" - echo "Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert" + echo "Valid types: feat, feature, fix, docs, style, refactor, perf, test, build, ci, chore, revert" exit 1 fi diff --git a/README.md b/README.md index 50ae7e55..cfd7b170 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,8 @@ all projects. │ └── users/ # User management │ ├── .github/ -│ └── workflows/ # CI/CD workflows -├── .pre-commit-config.yaml -├── commitlint.config.js +│ └── workflows/ # CI/CD workflows, validations, etc. +├── .pre-commit-config.yaml # Pre-commit hooks configuration ├── .gitignore └── README.md ``` @@ -385,25 +384,44 @@ These ensure code consistency and prevent configuration drift. If you want to add or modify a module: -1. Create a `feature/` or `fix/` branch. +1. Create a branch following the naming convention (see below). 2. Add tests or validations if applicable. 3. Update the module's documentation. 4. Open a Pull Request for review. +### Branch naming convention + +Branches must follow the pattern: `type/description` + +**Valid types:** `feat`, `feature`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert` + +**Examples:** + +```bash +feat/add-eks-module +feature/new-vpc-support +fix/resolve-iam-permissions +docs/update-readme +ci/add-validation-workflow +``` + ### Commit message format -This repository uses [Conventional Commits](https://www.conventionalcommits.org/) to ensure consistent commit messages. A pre-commit hook validates all commit messages automatically. +This repository uses [Conventional Commits](https://www.conventionalcommits.org/) to ensure consistent commit messages. CI validates all commit messages automatically. + +**Valid types:** `feat`, `feature`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert` **Valid commit examples:** ```bash feat: add new EKS module -feat(aws): add support for multiple availability zones +feature(aws): add support for multiple availability zones fix: resolve VPC peering connection issue fix(azure): correct DNS zone configuration docs: update README with usage examples refactor: simplify IAM role creation chore: update provider versions +ci: add security scanning workflow ``` **Invalid commit examples:** @@ -414,7 +432,7 @@ Fix bug # ❌ type must be lowercase feat add login # ❌ missing colon after type ``` -**Setup pre-commit hooks:** +**Setup pre-commit hooks (optional):** ```bash # Install pre-commit (if not already installed) diff --git a/commitlint.config.js b/commitlint.config.js index 422b1944..b06279bd 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,6 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [2, 'always', ['feat', 'feature', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert']], + }, +}; diff --git a/nullplatform/code_repository/provider.tf b/nullplatform/code_repository/provider.tf index a3f18aa9..928d5b65 100644 --- a/nullplatform/code_repository/provider.tf +++ b/nullplatform/code_repository/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { nullplatform = { source = "nullplatform/nullplatform" - version = ">= 0.0.67" + version = "~> 0.0.67" } } }