Skip to content
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

Feature request: support glob/asterisk in change_path #145

Open
Shaked opened this issue Mar 26, 2024 · 1 comment
Open

Feature request: support glob/asterisk in change_path #145

Shaked opened this issue Mar 26, 2024 · 1 comment

Comments

@Shaked
Copy link

Shaked commented Mar 26, 2024

The idea is to have an option to generate a version based on a more dynamic path. For example:

      - uses: paulhatch/[email protected]
        name: Generate version
        id: version
        with:
          tag_prefix: ""
          bump_each_commit: true
          version_format: "${major}.${minor}.${patch}"
          change_path: "path/**/platform"

In my case, I have dynamically generated directories under path and I want to follow all changes under their ./platform directory and tag it.

Another idea would be to support a file pattern, like all files containing a specific string or extension e.g. platform_*.yaml or *.yaml

WDYT?

@frizzr
Copy link

frizzr commented Sep 4, 2024

So there is actually a workaround for this that I stumbled upon while reading the source code.

You can use $(...) in the change path since the source code is simply shelling out to a git log command with the change_path plugged in at the end after --. This allows you to use the power of the shell to include/exclude whatever you want.

In your case, you could make change_path

      - uses: paulhatch/[email protected]
        name: Generate version
        id: version
        with:
          tag_prefix: ""
          bump_each_commit: true
          version_format: "${major}.${minor}.${patch}"
          change_path: "$(ls -p path/**/platform/*)"

and it should do what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants