Skip to content

🚀[Feature]: Only publish if we have changes #85

Description

Description

Only publish if the important files have changes.

Discorvery

  • tj-actions/changed-files -> make a custom action? -> Will not run if the framework has changes.
  • git diff -> get list of files -> make a custom action? -> Will not run if the framework has changes.
  • get hash for published module and the built module -> Will take the result and compare => It will run if there are "external" changes that causes the compiled module to have changed.

Activity

  1. MariusStorhaug commented on Jan 28, 2026

    @MariusStorhaug
    MemberAuthor

    Resolved via PR #275

    This feature has been implemented using automatic file change detection in the Get-PSModuleSettings action.

    How It Works

    The action automatically detects whether a PR contains changes to "important" files that warrant a new release:

    1. Fetches changed files via GitHub API for each PR
    2. Matches files against important patterns
    3. Sets ReleaseType based on the result:
      • Release - Merged PR to default branch with important changes
      • Prerelease - Open/labeled PR with prerelease label and important changes
      • None - No important changes detected → no version bump, no publish

    Important File Patterns

    $importantPatterns = @(
        '^src/'
        '^examples/'
        '^README\.md$'
    )

    Files that trigger releases:

    Path Description
    src/** Module source code
    examples/** Example scripts
    README.md Documentation

    Files that do NOT trigger releases:

    • .github/workflows/* (all workflow configurations)
    • .github/linters/* (linter configs)
    • tests/** (test files)
    • .gitignore, .editorconfig, etc.

    User Feedback

    When no important files are changed, a comment is automatically added to the PR explaining why build/test/publish stages will be skipped.

    Rationale

    This approach ensures that only meaningful changes to the module content result in new releases, avoiding version inflation from CI/CD maintenance or test-only changes.

  2. added a commit that references this issue on Jan 28, 2026
    a152498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions