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

Apply mutally exclusive Age labels #158

Closed
himynameisdave opened this issue Nov 13, 2024 · 3 comments · Fixed by #159
Closed

Apply mutally exclusive Age labels #158

himynameisdave opened this issue Nov 13, 2024 · 3 comments · Fixed by #159

Comments

@himynameisdave
Copy link
Contributor

himynameisdave commented Nov 13, 2024

Hi there, great work on this Action. I am wondering if it's possible to apply different labels based on age. Right now I have a config which looks a bit like this:

  - label: "Age: Getting Stale"
    age: 8d

  - label: "Age: Quite Stale"
    age: 22d

The problem I am having with this is that it will apply both labels after 22 days, whereas I would ideally like it to simply apply one or the other based on the age of the pull request (or issue, but in my case for PRs). Something like this I guess (similar to the upper/lower limits for file changes).

  # Pseudo-code, don't actually use this!
  - label: "Age: Getting Stale"
    age:
      - older_than: 8d
      - newer_than: 22d
  
  # Pseudo-code, don't actually use this!
  - label: "Age: Quite Stale"
    age:
      - older_than: 22d

Is there a way to configure this already (maybe with a negate rule?), or is this something we would need to add? I know about the last modified matcher, but the goal is to label PRs which were originally opened a long time ago (doesn't matter if they have been touched recently).

If this is a new feature, please let me know where I can get started implementing this.

@srvaroa
Copy link
Owner

srvaroa commented Nov 14, 2024

Hi, thanks for reporting! Yes, this makes sense I should have considered this case :)

I think we can solve this by replicating the format of last modified. It's a small change so I can probably get it done soon. But if you want to take a stab at it this is what I'd have in mind:

  • Probably keep the at-least / at-most parameters mostly for consistency
  • Retain backwards compatibility. age: 33d should work.

@srvaroa
Copy link
Owner

srvaroa commented Nov 22, 2024

Released in v1.12.0, which is now the default version for @master

@himynameisdave
Copy link
Contributor Author

Thanks @srvaroa 💯

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

Successfully merging a pull request may close this issue.

2 participants