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

Add example of enable-versioned-regex #84

Open
gregsdennis opened this issue Feb 24, 2024 · 2 comments
Open

Add example of enable-versioned-regex #84

gregsdennis opened this issue Feb 24, 2024 · 2 comments

Comments

@gregsdennis
Copy link

gregsdennis commented Feb 24, 2024

The readme shows usage of enable-versioned-regex, but it doesn't explain what this does or why it should be used.

Is the property required? If not, what is the default if omitted?

@aarikpokras
Copy link

According to action.yml,

  enable-versioned-regex:
    description: 'Controls if versioned regex templates are being used'
    required: true

In other words, it is required. I have it set to zero.

@ferdnyc
Copy link

ferdnyc commented Dec 8, 2024

I'm confused, because it seems to me like "Example using versioned issue templates" does explain what it does and why it should be used.

As you iterate on your regular expressions, since maybe your issue template gets updated, this can have an impact on existing issues. The below allows you to version your regular expression definitions and pair them with issue templates.

Below is the body of an example issue which has the version identifier issue_labeler_regex_version embedded.

<!--
issue_labeler_regex_version=1
--!>

I have an urgent issue that requires someone's attention.

When the issue is evaluated it'll look for .github/labeler-v1.yml based on the configuration-path and the version number set in the issue.

What I guess isn't explicitly spelled out is that you'd use this in concert with the not-before argument (which is a timestamp) to ensure that the regular expressions used by issue labeler match the current design of the issue templates presented to users (presuming the templates contain fields that issue-labeler works off of).

If you're only running issue-labeler on "opened" issues and not "edited", then you don't have to version the expressions, because the other option is to just update them at the same time you update the templates.

And if you're not using expressions on the issue body/title to drive issue-labeler behavior (say, you're just adding the same label to all newly-created issues when they're opened, regardless of content) then you don't need to use the versioning feature at all, because it's only necessary if the actions issue-labeler should take depend on the age and/or content of the issue itself.

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

3 participants