dessant / lock-threads

GitHub Action that locks closed issues, pull requests and discussions after a period of inactivity
https://github.com/marketplace/actions/lock-threads
MIT License
313 stars 34 forks source link

Various updates #33

Closed jsumners closed 2 years ago

jsumners commented 2 years ago

This PR updates the used Node.js version, adds debug logging, and tweaks the query used.

I started this work because in pinojs/pino and fastify/fastify this action has stopped doing anything. While working on this, I determined that the following script works:

// index.mjs
import { Octokit } from '@octokit/core'
import { restEndpointMethods } from '@octokit/plugin-rest-endpoint-methods'

const MyOctokit = Octokit.plugin(restEndpointMethods)
const octokit = new MyOctokit()

const results = await octokit.rest.search.issuesAndPullRequests({
  q: 'repo:pinojs/pino updated:<2022-05-11T12:13:22Z state:closed state:unlocked is:issue'
})

console.log(JSON.stringify(results, null, 2))

Notice that is:closed is:unlocked is changed to state:closed state:unlocked. I get zero results with the is: form in that script.

dessant commented 2 years ago

This looks like a regression on GitHub, please report the bug at https://support.github.com. The action uses documented search qualifiers that do not appear to be deprecated, while state:unlocked seems to work but it is not documented. We could switch to the undocumented search qualifier if the regression is reported to GitHub and they don't fix it in a reasonable time.

https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-open-or-closed-state

https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-based-on-whether-a-conversation-is-locked

These links can be sent to GitHub support for quick testing:

https://github.com/search?q=repo%3Apinojs%2Fpino+updated%3A%3C2022-05-11T12%3A13%3A22Z+is%3Aclosed+is%3Aunlocked+is%3Aissue

https://github.com/search?q=repo%3Apinojs%2Fpino+updated%3A%3C2022-05-11T12%3A13%3A22Z+state%3Aclosed+state%3Aunlocked+is%3Aissue

dessant commented 2 years ago

@jsumners, have you already contacted GitHub, or should I send them a bug report?

jsumners commented 2 years ago

I have not contacted them.

daniellockyer commented 2 years ago

@dessant Is this Action still broken? I'd love to use it over at https://github.com/tryghost/ghost

dessant commented 2 years ago

It works now, the problem must have been fixed by GitHub.