Skip to content

Commit 024c19f

Browse files
authored
feat: update terraform-docs version to v0.21.0 across configuration and documentation (#380)
1 parent 70257e2 commit 024c19f

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
disable-wiki: false
5050
wiki-sidebar-changelog-max: 10
5151
delete-legacy-tags: false # Note: We don't want to delete tags in this repository
52-
terraform-docs-version: v0.20.0
52+
terraform-docs-version: v0.21.0
5353
module-path-ignore: tf-modules/kms/examples/complete,tf-modules/zoo,tf-modules/animal,tf-modules/s3-bucket-object
5454
module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**,examples/**
5555
module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ configuring the following optional input parameters as needed.
192192
| `patch-keywords` | Keywords in commit messages that indicate a patch release. Only used when `semver-mode` is `keywords`. | `fix,chore,docs` |
193193
| `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` |
194194
| `default-first-tag` | Specifies the default tag version | `v1.0.0` |
195-
| `terraform-docs-version` | Specifies the terraform-docs version used to generate documentation for the wiki | `v0.19.0` |
195+
| `terraform-docs-version` | Specifies the terraform-docs version used to generate documentation for the wiki | `v0.21.0` |
196196
| `delete-legacy-tags` | Specifies a boolean that determines whether tags and releases from Terraform modules that have been deleted should be automatically removed | `true` |
197197
| `disable-wiki` | Whether to disable wiki generation for Terraform modules | `false` |
198198
| `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:
405405
semver-mode: conventional-commits
406406
default-semver-level: patch
407407
default-first-tag: v1.0.0
408-
terraform-docs-version: v0.20.0
408+
terraform-docs-version: v0.21.0
409409
delete-legacy-tags: true
410410
disable-wiki: false
411411
wiki-sidebar-changelog-max: 10

__tests__/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe('config', () => {
333333
expect(config.patchKeywords).toEqual(['fix', 'chore', 'docs']);
334334
expect(config.defaultSemverLevel).toBe('patch');
335335
expect(config.defaultFirstTag).toBe('v1.0.0');
336-
expect(config.terraformDocsVersion).toBe('v0.20.0');
336+
expect(config.terraformDocsVersion).toBe('v0.21.0');
337337
expect(config.deleteLegacyTags).toBe(true);
338338
expect(config.disableWiki).toBe(false);
339339
expect(config.wikiSidebarChangelogMax).toBe(5);
@@ -354,7 +354,7 @@ describe('config', () => {
354354
['Semver Mode: conventional-commits'],
355355
['Default Semver Level: patch'],
356356
['Default First Tag: v1.0.0'],
357-
['Terraform Docs Version: v0.20.0'],
357+
['Terraform Docs Version: v0.21.0'],
358358
['Delete Legacy Tags: true'],
359359
['Disable Wiki: false'],
360360
['Wiki Sidebar Changelog Max: 5'],

__tests__/terraform-docs.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ vi.mock('node:util', () => ({
4141
}));
4242

4343
describe('terraform-docs', async () => {
44-
const terraformDocsVersion = 'v0.20.0';
44+
const terraformDocsVersion = 'v0.21.0';
4545
const mockExecFileSync = vi.mocked(execFileSync);
4646
const mockWhichSync = vi.mocked(which.sync);
4747
const fsExistsSyncMock = vi.mocked(existsSync);
@@ -192,24 +192,24 @@ describe('terraform-docs', async () => {
192192

193193
describe('terraform-docs version validation', () => {
194194
it('should accept valid version format', () => {
195-
expect(() => installTerraformDocs('v0.19.0')).not.toThrow();
195+
expect(() => installTerraformDocs('v0.21.0')).not.toThrow();
196196
});
197197

198198
it.each([
199-
['0.19.0', 'missing v prefix'],
200-
['v0.19', 'incomplete version'],
201-
['v0.19.0.0', 'too many segments'],
199+
['0.21.0', 'missing v prefix'],
200+
['v0.21', 'incomplete version'],
201+
['v0.21.0.0', 'too many segments'],
202202
['vabc.19.0', 'invalid major version'],
203203
['v0.abc.0', 'invalid minor version'],
204-
['v0.19.abc', 'invalid patch version'],
204+
['v0.21.abc', 'invalid patch version'],
205205
['', 'empty string'],
206206
['v', 'only prefix'],
207207
['v.0.0', 'missing major version'],
208208
['v0..0', 'missing minor version'],
209209
['v0.0.', 'missing patch version'],
210210
])('should throw error for invalid version format: %s (%s)', (version, _description) => {
211211
expect(() => installTerraformDocs(version)).toThrow(
212-
`Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.19.0)`,
212+
`Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.21.0)`,
213213
);
214214
});
215215
});

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ inputs:
6868
6969
See: https://github.com/terraform-docs/terraform-docs/releases
7070
required: true
71-
default: v0.20.0
71+
default: v0.21.0
7272
delete-legacy-tags:
7373
description: >
7474
Specifies a boolean that determines whether tags from Terraform modules that have been deleted

scripts/parse-modules-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function main() {
2626
process.env['INPUT_MINOR-KEYWORDS'] = 'feat,feature';
2727
process.env['INPUT_PATCH-KEYWORDS'] = 'fix,chore,docs';
2828
process.env['INPUT_DEFAULT-FIRST-TAG'] = 'v1.0.0';
29-
process.env['INPUT_TERRAFORM-DOCS-VERSION'] = 'v0.20.0';
29+
process.env['INPUT_TERRAFORM-DOCS-VERSION'] = 'v0.21.0';
3030
process.env['INPUT_DELETE-LEGACY-TAGS'] = 'false';
3131
process.env['INPUT_DISABLE-WIKI'] = 'true';
3232
process.env['INPUT_WIKI-SIDEBAR-CHANGELOG-MAX'] = '5';

src/terraform-docs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function validateTerraformDocsVersion(version: string): void {
129129
const versionPattern = /^v\d+\.\d+\.\d+$/;
130130
if (!versionPattern.test(version)) {
131131
throw new Error(
132-
`Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.19.0)`,
132+
`Invalid terraform-docs version format: ${version}. Version must match the format v#.#.# (e.g., v0.21.0)`,
133133
);
134134
}
135135
}
@@ -186,7 +186,7 @@ export function installTerraformDocs(terraformDocsVersion: string): void {
186186
`Move-Item -Path "./terraform-docs/terraform-docs.exe" -Destination "${systemDir}\\terraform-docs.exe"`,
187187
]);
188188

189-
// terraform-docs version v0.19.0 af31cc6 windows/amd64
189+
// terraform-docs version v0.21.0 af31cc6 windows/amd64
190190
execFileSync(`${systemDir}\\terraform-docs.exe`, ['--version'], { stdio: 'inherit' });
191191
} else {
192192
const commands = ['curl', 'tar', 'chmod', 'sudo'];
@@ -202,7 +202,7 @@ export function installTerraformDocs(terraformDocsVersion: string): void {
202202
execFileSync(paths.chmod, ['+x', 'terraform-docs']);
203203
execFileSync(paths.sudo, ['mv', 'terraform-docs', '/usr/local/bin/terraform-docs']);
204204

205-
// terraform-docs version v0.19.0 af31cc6 linux/amd64
205+
// terraform-docs version v0.21.0 af31cc6 linux/amd64
206206
execFileSync('/usr/local/bin/terraform-docs', ['--version'], { stdio: 'inherit' });
207207
}
208208
} finally {

0 commit comments

Comments
 (0)