Skip to content

im-open/identify-changes-action

Repository files navigation

🛠️ Increment Version on Merge

Identify Changes Action

Determines if there are changes based on patterns or expressions against file blobs within the repo.

Utilizes minmatch for glob comparisions.

See https://globster.xyz/ and https://datacadamia.com/lang/regexp/glob for help in pattern syntax

Index

Inputs

Parameter Is Required Default Description
github-token true Token required to compare and identify changes against GitHub repo.
reference false Current context Reference to evaluate for changes.
base-reference false Latest release Base reference to compare against.
pattern false Identify changes with defined blob matching pattern. Can supply multiple on seperate lines.
exclude-pattern false Excludes identified changes. Can supply multiple on seperate lines.
patterns false Identify changes with these defined blob matching patterns outputing individual results
options false see action definition Options when comparing using blob patterns; see minmatch.

Additional inputs can be found on the action definition

Outputs

Output Description
result true or false if any changes were identified
patterns... For each typed-pattern, an output will be produced with a true / false value if changes identified

Usage Examples

jobs:
  jobname:
    runs-on: ubuntu-latest
    steps:
      - name: Identify Changes
        uses: im-enrollment/identify-changes-actionn@latest
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          pattern: | # concatenates patterns into {src/ProjectName/**,src/ProjectName2/**}
            src/ProjectName/**
            src/ProjectName2/**
          exclude-pattern: |
            src/ProjectName/**/*.js

        # Step Output Vars
        outputs.result = 'true'

      # ----------------------------------

      - name: Identify Multiple Changes
        uses: im-enrollment/identify-changes-actionn@latest
        id: identify-changes
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          reference: ${{ github.ref_name }}
          patterns: |
            {
              "projectA": "src/ProjectA/**",
              "projectB:" "src/ProjectB/**",
              "frontEndTests": "src/ProjectA/FrontEnd/*.tests.js",
              "systemTests": "tests/**"
            }

        # Step Output Vars
        outputs.result = 'true' // Are there any changes in any of the patterns provided
        outputs.projectA = 'false'
        outputs.projectB = 'true'
        outputs.frontEndTests = 'false'
        outputs.systemTests = 'false'

See workflow automated test for more examples

Contributing

When creating new PRs please ensure:

  1. The action has been recompiled. See the Recompiling section below for more details.
  2. For major or minor changes, at least one of the commit messages contains the appropriate +semver: keywords listed under Incrementing the Version.
  3. The README.md example has been updated with the new version. See Incrementing the Version.
  4. The action code does not contain sensitive information.

Recompiling

If changes are made to the action's code in this repository, or its dependencies, you will need to re-compile the action.

# Installs dependencies and bundles the code
npm start

# Bundle the code (if dependencies are already installed)
npm run build

These commands utilize esbuild to bundle the action and its dependencies into a single file located in the dist folder.

Incrementing the Version

This action uses git-version-lite to examine commit messages to determine whether to perform a major, minor or patch increment on merge. The following table provides the fragment that should be included in a commit message to active different increment strategies.

Increment Type Commit Message Fragment
major +semver:breaking
major +semver:major
minor +semver:feature
minor +semver:minor
patch default increment type, no comment needed

Code of Conduct

This project has adopted the im-open's Code of Conduct.

License

Copyright © 2022, Extend Health, LLC. Code released under the MIT license.

About

Determines if there are changes based on path provided

Topics

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

2 watching

Forks

Contributors