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

[Snyk] Security upgrade @keystone-next/fields from 9.0.0 to 15.0.0 #6

Open
wants to merge 8 commits into
base: canary
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/actions/minus-one/index.mjs

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions .github/actions/minus-one/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { graphql } from '@octokit/graphql'

if (!process.env.GITHUB_TOKEN) throw new Error('GITHUB_TOKEN not set')

/**
/** @runners or helpers
help build nextjs.org + vercel body and deploy to next js

MIT License

Copyright (c) Sindre Sorhus [email protected] (sindresorhus.com)
Expand All @@ -16,15 +18,18 @@ The above copyright notice and this permission notice shall be included in all c

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Borrowed from Refined GitHub:
// https://github.com/refined-github/refined-github/blob/c864a20b57bb433aaf3952f88d83c9fc481ae6ff/source/helpers/is-low-quality-comment.ts#L2-L3
const unhelpfulRe =
/[\s,.!?👍👎👌🙏]+|[\u{1F3FB}-\u{1F3FF}]|[+-]\d+|⬆️|ditt?o|me|too|t?here|on|same|this|issues?|please|pl[sz]|any|updates?|bump|question|solution|following/giu
function isUnhelpfulComment(text) {
// Borrowed from Refined GitHub:
// https://github.com/refined-github/refined-github/blob/c864a20b57bb433aaf3952f88d83c9fc481ae6ff/source/helpers/is-low-quality-comment.ts#L2-L3
return (
text.replace(
/[\s,.!?👍👎👌🙏]+|[\u{1F3FB}-\u{1F3FF}]|[+-]\d+|⬆️|ditt?o|me|too|t?here|on|same|this|issues?|please|pl[sz]|any|updates?|bump|question|solution|following/giu,
''
) === ''
)
return text.replace(unhelpfulRe, '') === ''
}

const stillRe = /(still\s(same|happen(ing|s))|same\son)/gi
const linkRe = /https?:\/\/[^\s/$.?#].[^\s]*/g
function isStillHappeningWithoutLink(text) {
return stillRe.test(text) && !linkRe.test(text)
}

async function run() {
Expand All @@ -34,7 +39,7 @@ async function run() {

const { node_id: subjectId, body } = comment

if (isUnhelpfulComment(body)) {
if (isUnhelpfulComment(body) || isStillHappeningWithoutLink(body)) {
await graphql(
`
mutation minimize($subjectId: ID!) {
Expand Down
Loading
Loading