Skip to content

feat: add asset and exclude pattern filtering for module releases #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

virgofx
Copy link
Member

@virgofx virgofx commented Oct 25, 2024

Overview

This PR introduces new configuration options to allow finer control over which files influence module releases and which files are included in release assets. These changes enable users to specify patterns for files that should be ignored for module versioning and asset bundling.

Changes

  1. New Inputs for File Exclusions in action.yml:

    • module-change-exclude-patterns: Defines patterns for files that should not trigger module changes.
    • module-asset-exclude-patterns: Defines patterns for files that should be excluded from module assets.
    • Added validation to prevent .tf files from being excluded by these patterns.
  2. Core Implementation of File Pattern Filtering:

    • Introduced a file filtering system using minimatch for glob pattern matching.
    • Added helper functions for file filtering:
      • shouldExcludeFile: Determines if a file should be excluded based on patterns.
    • Modified module detection logic to respect the new exclude patterns.
  3. Documentation Updates:

    • Updated input parameters documentation to include descriptions for the new pattern inputs.
    • Added usage examples and warnings in the parameter descriptions.

Default Configurations

  • module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/*
  • module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/*

Fixes

@virgofx virgofx added the enhancement New feature or request label Oct 25, 2024
@virgofx virgofx self-assigned this Oct 25, 2024
@virgofx virgofx force-pushed the 79-exclude-tftesthcl-files-from-built-assets branch 21 times, most recently from 566f910 to 699d507 Compare October 26, 2024 21:17
Add new configuration options to control which files are included in releases
and which files trigger module changes:

- feat(config): add module-change-exclude-patterns and
  module-asset-exclude-patterns inputs to action.yml
  - module-change-exclude-patterns: controls which files exclude module changes
  - module-asset-exclude-patterns: controls which files to exclude in module assets
  - add validation to prevent *.tf exclusion

- feat(core): implement file pattern filtering system
  - add minimatch for glob pattern matching
  - add helper functions for file filtering:
    - shouldExcludeFile
  - modify module detection to respect exclude patterns

- chore(docs): update input parameters documentation
  - add descriptions for new pattern inputs
  - include examples and warnings in parameter descriptions

Default configurations:
- module-change-exclude-patterns: ".gitignore,*.md,*.tftest.hcl,tests/*"
- module-asset-exclude-patterns: ".gitignore,*.md,*.tftest.hcl,tests/*"

Fixes #79
@virgofx virgofx force-pushed the 79-exclude-tftesthcl-files-from-built-assets branch from 699d507 to 4b0e6ab Compare October 26, 2024 21:18
Copy link

Copy link

Release Plan

No terraform modules updated in this pull request.

✅ Wiki Check ℹ️

Note: The following Terraform modules no longer exist in source; however, corresponding tags/releases exist. Automation tag/release deletion is disabledno subsequent action will take place.

v1.2.0, v1.1.1, v1.1.0, v1.0.1, v1.0.0, v1

Powered by techpivot/terraform-module-releaser

@virgofx virgofx merged commit 7227a38 into main Oct 26, 2024
7 checks passed
@virgofx virgofx deleted the 79-exclude-tftesthcl-files-from-built-assets branch October 26, 2024 21:21
@virgofx virgofx mentioned this pull request Oct 26, 2024
@release-preview release-preview bot mentioned this pull request Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant