diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cbaed73..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 @@ -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: # `#.#.#-.#` where the suffix is optional. script: | - const message = '${{ github.event.head_commit.message }}' - const regex = /^bump:.+(?\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:.+(?\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. @@ -72,6 +76,7 @@ jobs: --exclude='.github' \ --exclude='.cz.yaml' \ --exclude='*.tar.gz' \ + --exclude='*.tfvars' \ --exclude='release.md' \ --exclude='CODEOWNERS' \ --exclude='trivy.yaml' \ 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 837adce..48b9c62 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 } ``` @@ -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