Skip to content

Examples directory causing error #169

Closed
@abell-agero

Description

@abell-agero

Hi,

I am trying to use this action when copying public AWS modules into a private repo. When doing so, those modules have an examples subfolder of the module. I was adding the KMS module under aws folder and this is the output of the action running:

Fetching pull request commits
  Found 18 files changed in pull request.
  [
    "aws/kms/CHANGELOG.md",
    "aws/kms/LICENSE",
    "aws/kms/README.md",
    "aws/kms/examples/README.md",
    "aws/kms/examples/complete/README.md",
    "aws/kms/examples/complete/main.tf",
    "aws/kms/examples/complete/outputs.tf",
    "aws/kms/examples/complete/variables.tf",
    "aws/kms/examples/complete/versions.tf",
    "aws/kms/main.tf",
    "aws/kms/outputs.tf",
    "aws/kms/variables.tf",
    "aws/kms/versions.tf",
    "aws/kms/wrappers/README.md",
    "aws/kms/wrappers/main.tf",
    "aws/kms/wrappers/outputs.tf",
    "aws/kms/wrappers/variables.tf",
    "aws/kms/wrappers/versions.tf"
  ]
  Found 1 commit.
  Elapsed time fetching commits: 845.887ms
Fetching repository tags
Fetching repository releases
Finding all Terraform modules with corresponding changes
  Parsing commit 3b7cff32a4fa4f9862613579e594464ed7d66839: Add KMS module v3.1.1 (Changed Files = 18)
  Analyzing file: aws/kms/CHANGELOG.md
  Excluding module "aws/kms" match from "aws/kms/CHANGELOG.md" due to exclude pattern match.
  Analyzing file: aws/kms/LICENSE
  Analyzing file: aws/kms/README.md
  Excluding module "aws/kms" match from "aws/kms/README.md" due to exclude pattern match.
  Analyzing file: aws/kms/examples/README.md
  Excluding module "aws/kms" match from "aws/kms/examples/README.md" due to exclude pattern match.
  Analyzing file: aws/kms/examples/complete/README.md
  Excluding module "aws/kms/examples/complete" match from "aws/kms/examples/complete/README.md" due to exclude pattern match.
  Analyzing file: aws/kms/examples/complete/main.tf
  Error: Found changed file "aws/kms/examples/complete/main.tf" associated with a terraform module "aws/kms/examples/complete"; however, associated module does not exist

My action has examples in the excluded dirs:

name: Terraform Module Releaser
on:
  pull_request:
    types: [opened, reopened, synchronize, closed] # Closed required
    branches:
      - main

permissions:
  contents: write # Required for to push tags, create release, and push changes to the wiki
  pull-requests: write # Required to comment on pull request

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Terraform Module Releaser
        uses: techpivot/terraform-module-releaser@v1
        with:
          major-keywords: major update,breaking change
          minor-keywords: feat,feature
          patch-keywords: fix,chore,docs
          default-first-tag: v1.0.0
          terraform-docs-version: v0.19.0
          delete-legacy-tags: false
          disable-wiki: true
          wiki-sidebar-changelog-max: 10
          module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**,examples/**
          module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**,examples/**
          use-ssh-source-format: false

Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions