Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions __tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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'],
Expand Down
14 changes: 7 additions & 7 deletions __tests__/terraform-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -192,24 +192,24 @@ 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'],
['v0..0', 'missing minor version'],
['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)`,
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/parse-modules-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions src/terraform-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)`,
);
}
}
Expand Down Expand Up @@ -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'];
Expand All @@ -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 {
Expand Down
Loading