Skip to content

Commit

Permalink
docs: Updated formatting of documentation. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes authored Nov 14, 2024
1 parent cd506e2 commit 1ef65db
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 11 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,16 +53,18 @@ jobs:
- name: Get the version from the commit message
id: version
uses: actions/github-script@v7
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
with:
result-encoding: string
# Look for the last version number, expecting it to be in the format:
# `#.#.#-<suffix>.#` where the suffix is optional.
script: |
const message = '${{ github.event.head_commit.message }}'
const regex = /^bump:.+(?<version>\d+\.\d+\.\d+[\da-z.-]*) \(#\d+\)$/
const version = message.match(regex).groups.version
console.log(version)
return version
const message = process.env.COMMIT_MESSAGE;
const regex = /^bump:.+(?<version>\d+\.\d+\.\d+[\da-z.-]*) \(#\d+\)$/m;
const version = message.match(regex).groups.version;
console.log(version);
return version;
- name: Bundle the module
# We create an empty file first, so that tar doesn't complain about the
# contents changing while it's running.
Expand All @@ -72,6 +76,7 @@ jobs:
--exclude='.github' \
--exclude='.cz.yaml' \
--exclude='*.tar.gz' \
--exclude='*.tfvars' \
--exclude='release.md' \
--exclude='CODEOWNERS' \
--exclude='trivy.yaml' \
Expand Down
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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/
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aptible Managed Endpoint Module

[![Main Checks](https://github.com/codeforamerica/tofu-modules-aptible-managed-endpoint/actions/workflows/main.yaml/badge.svg)](https://github.com/codeforamerica/tofu-modules-aptible-managed-endpoint/actions/workflows/main.yaml) ![GitHub Release](https://img.shields.io/github/v/release/codeforamerica/tofu-modules-aptible-managed-endpoint?logo=github&label=Latest%20Release)
[![Main Checks][badge-checks]][code-checks] [![GitHub Release][badge-release]][latest-release]

This module creates a [managed HTTPS endpoint][endpoint] in Aptible. It will
also create the necessary DNS records in Route 53 to verify the domain and
Expand All @@ -13,13 +13,13 @@ to match your desired configuration. For example:

```hcl
module "endpoint" {
source = "github.com/codeforamerica/tofu-modules-aptible-managed-endpoint"
source = "github.com/codeforamerica/tofu-modules-aptible-managed-endpoint?ref=1.0.0"
aptible_environment = "my-environment"
aptible_resource = 12345
domain = "my-project.org"
subdomain = "www"
public = true
aptible_resource = 12345
domain = "my-project.org"
subdomain = "www"
public = true
}
```

Expand Down Expand Up @@ -55,4 +55,8 @@ tofu init -upgrade
| fqdn | Fully qualified domain name for the HTTPS endpoint. | `number` |
| hostname | Hostname of the endpoint that was created. | `string` |

[badge-checks]: https://github.com/codeforamerica/tofu-modules-aptible-managed-endpoint/actions/workflows/main.yaml/badge.svg
[badge-release]: https://img.shields.io/github/v/release/codeforamerica/tofu-modules-aptible-managed-endpoint?logo=github&label=Latest%20Release
[code-checks]: https://github.com/codeforamerica/tofu-modules-aptible-managed-endpoint/actions/workflows/main.yaml
[endpoint]: https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/https-endpoints/overview
[latest-release]: https://github.com/codeforamerica/tofu-modules-aptible-managed-endpoint/releases/latest

0 comments on commit 1ef65db

Please sign in to comment.