FantasticFiasco / action-update-license-year

GitHub Action that in a pull request updates the copyright year(s) in your license file.
Apache License 2.0
58 stars 2 forks source link

Glob for candidates #312

Open windymelt opened 1 year ago

windymelt commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm going to use this action to update copyright information in template file (for XSlate template engine) using custom transform feature.

Of course, not all of template contains copyright year information. Currently I have to specify accurate file path that contains copyright year manually.

Describe the solution you'd like

If this action provides option that ignores regex mismatch, I will be able to use glob to specify target candidates.

Describe alternatives you've considered

Additional context

my transform is like this:

jobs:
  update-license-year:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: FantasticFiasco/action-update-license-year@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          path: templates/**/*.html
          transform: '(?<=<div class="copyright">Copyright &copy; )(?<from>\d{4})?(&ndash;)?(\d{4})?'

some of template contains following line:

<div class="copyright">Copyright &copy; 2005&ndash;2022 <a href="https://example.com/">Foobar Inc</a>. All Rights Reserved.</div>
github-actions[bot] commented 1 year ago

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

FantasticFiasco commented 1 year ago

Hi @windymelt! This sounds like a feature we could implement, but let's have this issue open to see if others might find this useful as well. With enough interest we'll implement it!