From f9d1691a731f070c5f9aa150d8673faa334dfaf9 Mon Sep 17 00:00:00 2001 From: "James Armes (they/them)" Date: Thu, 14 Nov 2024 14:58:20 -0500 Subject: [PATCH] docs: Updated documentation formatting. (#5) --- .github/workflows/release.yaml | 2 ++ CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++ README.md | 15 +++++++---- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5dd5f63..1fb4223 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Bump version and create changelog id: bump uses: commitizen-tools/commitizen-action@master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..347cab4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing + +## Commit message format + +All commit messages should follow the [Conventional Commits][commits] format. +This format allows us to automatically generate changelogs and version numbers +based on the commit messages. + +Common commit types include: + +* `fix`: A bug fix +* `feat`: A new feature +* `ci`: Changes to CI/CD +* `docs`: Changes to documentation + +adding `!` after the type indicates a breaking change. For example, `feat!` +would indicate a new feature that breaks existing functionality, and would +therefore require a major version bump. + +`bump` is a special type used to indicate a version bump. This is used by the +automated release process, and should be avoided in normal commits. + +## Coding standards + +Code should follow the [OpenTofu style conventions][style]. This ensures that +all code is consistent and easy to read and maintain. + +To make resources easier to find, you may group them together in a single file +within your module. For example, while `main.tf` handles the main configuration, +you may create a `dns.tf` file to handle all DNS-related resources. + +Additionally, the following should be grouped together within their own files: + +* `data.tf` for data sources +* `local.tf` for local values +* `output.tf` for outputs + +## Code reviews + +All code should be contributing in the form of a pull request. Pull requests +should have an approval from _at least_ one required reviewer as defined in the +`CODEOWNERS` file. Additional reviews are welcome, and may be requested by +either the submitter or the required reviewer. + +[commits]: https://www.conventionalcommits.org/en/v1.0.0/ +[style]: https://opentofu.org/docs/language/syntax/style/ diff --git a/README.md b/README.md index 3183dec..9f0d5fc 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ # AWS Backend Module -[![Main Checks](https://github.com/codeforamerica/tofu-modules-aws-backend/actions/workflows/main.yaml/badge.svg)](https://github.com/codeforamerica/tofu-modules-aws-backend/actions/workflows/main.yaml) ![GitHub Release](https://img.shields.io/github/v/release/codeforamerica/tofu-modules-aws-backend?logo=github&label=Latest%20Release) +[![Main Checks][badge-checks]][code-checks] [![GitHub Release][badge-release]][latest-release] This module creates an AWS backend for OpenTofu. ## Usage -> **Note:** These steps must be completed _before_ adding the backend -> configuration to your `main.tf` file. +> [!NOTE] +> These steps must be completed _before_ adding the backend configuration to +> your `main.tf` file. Add this module to your `main.tf` (or appropriate) file and configure the inputs to match your desired configuration. For example: ```hcl module "backend" { - source = "github.com/codeforamerica/tofu-modules-aws-backend" + source = "github.com/codeforamerica/tofu-modules-aws-backend?ref=1.0.0" project = "my-project" environment = "dev" @@ -68,10 +69,14 @@ You now have a fully configured AWS backend for your project! | key_recovery_period | The number of days to retain the KMS key for recovery after deletion. | `number` | `30` | no | | tags | Optional tags to be applied to all resources. | `list` | `[]` | no | - ## Outputs | Name | Description | Type | |---------|------------------------------------------|----------| | bucket | Name of the S3 bucket for state storage. | `string` | | kms_key | KMS key used to encrypt state. | `string` | + +[badge-checks]: https://github.com/codeforamerica/tofu-modules-aws-backend/actions/workflows/main.yaml/badge.svg +[badge-release]: https://img.shields.io/github/v/release/codeforamerica/tofu-modules-aws-backend?logo=github&label=Latest%20Release +[code-checks]: https://github.com/codeforamerica/tofu-modules-aws-backend/actions/workflows/main.yaml +[latest-release]: https://github.com/codeforamerica/tofu-modules-aws-backend/releases/latest