Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would I search Github issues created in the last x days?

Also asked here but in 2016 and with no working answer.

I'd like to search for issues created x number of days ago, but can only find how to search using actual (hardcoded, if you will) dates. For example, I want to search for issues created less than 7 days ago.

I've read through their search syntax documentation and cannot figure out a way to do that.

like image 721
zeepk Avatar asked Sep 11 '25 15:09

zeepk


2 Answers

Currently, as mentioned in their Search Syntax docs:

You can search for dates that are earlier or later than another date, or that fall within a range of dates, by using >, >=, <, <=, and range queries. Date formatting must follow the ISO8601 standard, which is YYYY-MM-DD (year-month-day).

Meaning, unfortunately, they do not provide an out-of-the-box approach for you to do this relative searching.

If you're using the UI search, you can use the sort to be by Newest, while if you're using the API/GraphQL, you will need to write a function to take in the x number of days, generate a compliant ISO8601 date and pass to your request.

Not the answer you were hoping for, but I hope this helps clarify it.

like image 52
Troy Poulter Avatar answered Sep 15 '25 22:09

Troy Poulter


You can use a website that I built specifically for this scenario GitHub Issue Search it has usage information if any required parameters are missing.

Parameters: (As of 8/2/2024)

owner: The GitHub username or organization that owns the repository. Example: owner=opensearch-project

repo: The name of the GitHub repository. Example: repo=OpenSearch

tag: The label used to filter issues. Example: tag=untriaged

created-since-days: The number of days back from today to filter issues by creation date. Example: created-since-days=14

Full Example: https://peternied.github.io/redirect/issue_search.html?owner=opensearch-project&repo=OpenSearch&tag=untriaged&created-since-days=75

As @Troy mentions GitHub does yet not supported this scenario, but this is the best I've come up with for user-interactive scenarios.

Note; this tool might not cover all use cases. If you've got suggestions or improvements open a pull request or issue on GitHub.

like image 32
Peter Nied Avatar answered Sep 15 '25 20:09

Peter Nied



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!