diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb454af..acd4541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: disable-wiki: false wiki-sidebar-changelog-max: 10 delete-legacy-tags: false # Note: We don't want to delete tags in this repository - terraform-docs-version: v0.20.0 + terraform-docs-version: v0.21.0 module-path-ignore: tf-modules/kms/examples/complete,tf-modules/zoo,tf-modules/animal,tf-modules/s3-bucket-object module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**,examples/** module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/** diff --git a/README.md b/README.md index 78e52cd..5ff5f00 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ configuring the following optional input parameters as needed. | `patch-keywords` | Keywords in commit messages that indicate a patch release. Only used when `semver-mode` is `keywords`. | `fix,chore,docs` | | `default-semver-level` | The default semantic version level to use when a commit does not match any conventional commit types or configured keywords. Valid values: `patch`, `minor`, `major`. Only applies when NO commits match any rules. If any commit matches a rule, that matched level takes precedence. | `patch` | | `default-first-tag` | Specifies the default tag version | `v1.0.0` | -| `terraform-docs-version` | Specifies the terraform-docs version used to generate documentation for the wiki | `v0.19.0` | +| `terraform-docs-version` | Specifies the terraform-docs version used to generate documentation for the wiki | `v0.21.0` | | `delete-legacy-tags` | Specifies a boolean that determines whether tags and releases from Terraform modules that have been deleted should be automatically removed | `true` | | `disable-wiki` | Whether to disable wiki generation for Terraform modules | `false` | | `wiki-sidebar-changelog-max` | An integer that specifies how many changelog entries are displayed in the sidebar per module | `5` | @@ -405,7 +405,7 @@ jobs: semver-mode: conventional-commits default-semver-level: patch default-first-tag: v1.0.0 - terraform-docs-version: v0.20.0 + terraform-docs-version: v0.21.0 delete-legacy-tags: true disable-wiki: false wiki-sidebar-changelog-max: 10 diff --git a/__tests__/config.test.ts b/__tests__/config.test.ts index 876ef71..6de8165 100644 --- a/__tests__/config.test.ts +++ b/__tests__/config.test.ts @@ -333,7 +333,7 @@ describe('config', () => { expect(config.patchKeywords).toEqual(['fix', 'chore', 'docs']); expect(config.defaultSemverLevel).toBe('patch'); expect(config.defaultFirstTag).toBe('v1.0.0'); - expect(config.terraformDocsVersion).toBe('v0.20.0'); + expect(config.terraformDocsVersion).toBe('v0.21.0'); expect(config.deleteLegacyTags).toBe(true); expect(config.disableWiki).toBe(false); expect(config.wikiSidebarChangelogMax).toBe(5); @@ -354,7 +354,7 @@ describe('config', () => { ['Semver Mode: conventional-commits'], ['Default Semver Level: patch'], ['Default First Tag: v1.0.0'], - ['Terraform Docs Version: v0.20.0'], + ['Terraform Docs Version: v0.21.0'], ['Delete Legacy Tags: true'], ['Disable Wiki: false'], ['Wiki Sidebar Changelog Max: 5'], diff --git a/__tests__/terraform-docs.test.ts b/__tests__/terraform-docs.test.ts index 8d1f169..7c43e02 100644 --- a/__tests__/terraform-docs.test.ts +++ b/__tests__/terraform-docs.test.ts @@ -41,7 +41,7 @@ vi.mock('node:util', () => ({ })); describe('terraform-docs', async () => { - const terraformDocsVersion = 'v0.20.0'; + const terraformDocsVersion = 'v0.21.0'; const mockExecFileSync = vi.mocked(execFileSync); const mockWhichSync = vi.mocked(which.sync); const fsExistsSyncMock = vi.mocked(existsSync); @@ -192,16 +192,16 @@ describe('terraform-docs', async () => { describe('terraform-docs version validation', () => { it('should accept valid version format', () => { - expect(() => installTerraformDocs('v0.19.0')).not.toThrow(); + expect(() => installTerraformDocs('v0.21.0')).not.toThrow(); }); it.each([ - ['0.19.0', 'missing v prefix'], - ['v0.19', 'incomplete version'], - ['v0.19.0.0', 'too many segments'], + ['0.21.0', 'missing v prefix'], + ['v0.21', 'incomplete version'], + ['v0.21.0.0', 'too many segments'], ['vabc.19.0', 'invalid major version'], ['v0.abc.0', 'invalid minor version'], - ['v0.19.abc', 'invalid patch version'], + ['v0.21.abc', 'invalid patch version'], ['', 'empty string'], ['v', 'only prefix'], ['v.0.0', 'missing major version'], @@ -209,7 +209,7 @@ describe('terraform-docs', async () => { ['v0.0.', 'missing patch version'], ])('should throw error for invalid version format: %s (%s)', (version, _description) => { expect(() => installTerraformDocs(version)).toThrow( - `Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.19.0)`, + `Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.21.0)`, ); }); }); diff --git a/action.yml b/action.yml index 7306ff0..572342e 100644 --- a/action.yml +++ b/action.yml @@ -68,7 +68,7 @@ inputs: See: https://github.com/terraform-docs/terraform-docs/releases required: true - default: v0.20.0 + default: v0.21.0 delete-legacy-tags: description: > Specifies a boolean that determines whether tags from Terraform modules that have been deleted diff --git a/scripts/parse-modules-test.ts b/scripts/parse-modules-test.ts index d3153c0..7dff9c5 100644 --- a/scripts/parse-modules-test.ts +++ b/scripts/parse-modules-test.ts @@ -26,7 +26,7 @@ async function main() { process.env['INPUT_MINOR-KEYWORDS'] = 'feat,feature'; process.env['INPUT_PATCH-KEYWORDS'] = 'fix,chore,docs'; process.env['INPUT_DEFAULT-FIRST-TAG'] = 'v1.0.0'; - process.env['INPUT_TERRAFORM-DOCS-VERSION'] = 'v0.20.0'; + process.env['INPUT_TERRAFORM-DOCS-VERSION'] = 'v0.21.0'; process.env['INPUT_DELETE-LEGACY-TAGS'] = 'false'; process.env['INPUT_DISABLE-WIKI'] = 'true'; process.env['INPUT_WIKI-SIDEBAR-CHANGELOG-MAX'] = '5'; diff --git a/src/terraform-docs.ts b/src/terraform-docs.ts index bd122f3..89ec812 100644 --- a/src/terraform-docs.ts +++ b/src/terraform-docs.ts @@ -129,7 +129,7 @@ function validateTerraformDocsVersion(version: string): void { const versionPattern = /^v\d+\.\d+\.\d+$/; if (!versionPattern.test(version)) { throw new Error( - `Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.19.0)`, + `Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.21.0)`, ); } } @@ -186,7 +186,7 @@ export function installTerraformDocs(terraformDocsVersion: string): void { `Move-Item -Path "./terraform-docs/terraform-docs.exe" -Destination "${systemDir}\\terraform-docs.exe"`, ]); - // terraform-docs version v0.19.0 af31cc6 windows/amd64 + // terraform-docs version v0.21.0 af31cc6 windows/amd64 execFileSync(`${systemDir}\\terraform-docs.exe`, ['--version'], { stdio: 'inherit' }); } else { const commands = ['curl', 'tar', 'chmod', 'sudo']; @@ -202,7 +202,7 @@ export function installTerraformDocs(terraformDocsVersion: string): void { execFileSync(paths.chmod, ['+x', 'terraform-docs']); execFileSync(paths.sudo, ['mv', 'terraform-docs', '/usr/local/bin/terraform-docs']); - // terraform-docs version v0.19.0 af31cc6 linux/amd64 + // terraform-docs version v0.21.0 af31cc6 linux/amd64 execFileSync('/usr/local/bin/terraform-docs', ['--version'], { stdio: 'inherit' }); } } finally {