From e9b3b505b324df5cbd72740a7376d09e66e5a4a6 Mon Sep 17 00:00:00 2001 From: chris48s Date: Fri, 11 Aug 2023 16:31:13 +0100 Subject: [PATCH] delete close-bot (#9468) --- .github/actions/close-bot/action.yml | 12 - .github/actions/close-bot/helpers.js | 68 --- .github/actions/close-bot/index.js | 38 -- .github/actions/close-bot/package-lock.json | 431 -------------------- .github/actions/close-bot/package.json | 16 - .github/workflows/auto-close.yml | 22 - 6 files changed, 587 deletions(-) delete mode 100644 .github/actions/close-bot/action.yml delete mode 100644 .github/actions/close-bot/helpers.js delete mode 100644 .github/actions/close-bot/index.js delete mode 100644 .github/actions/close-bot/package-lock.json delete mode 100644 .github/actions/close-bot/package.json delete mode 100644 .github/workflows/auto-close.yml diff --git a/.github/actions/close-bot/action.yml b/.github/actions/close-bot/action.yml deleted file mode 100644 index dd7eb2beec2f4..0000000000000 --- a/.github/actions/close-bot/action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Auto Approve' -description: 'Automatically approve/close selected pull requests for shields.io' -branding: - icon: 'check-circle' - color: 'green' -inputs: - github-token: - description: 'The GITHUB_TOKEN secret' - required: true -runs: - using: 'node16' - main: 'index.js' diff --git a/.github/actions/close-bot/helpers.js b/.github/actions/close-bot/helpers.js deleted file mode 100644 index 2f29e7750616a..0000000000000 --- a/.github/actions/close-bot/helpers.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -function findChangelogStart(lines) { - for (let i = 0; i < lines.length; i++) { - const line = lines[i] - if ( - line === 'Changelog' && - lines[i + 2] === '
' - ) { - return i + 3 - } - } - return null -} - -function findChangelogEnd(lines, start) { - for (let i = start; i < lines.length; i++) { - const line = lines[i] - if (line === '
') { - return i - } - } - return null -} - -function allChangelogLinesAreVersionBump(changelogLines) { - return ( - changelogLines.length > 0 && - changelogLines.length === - changelogLines.filter(line => - line.includes('Version bump only for package'), - ).length - ) -} - -function isPointlessVersionBump(body) { - const pointlessBumpLinks = [ - 'https://github.com/typescript-eslint/typescript-eslint', - ] - - const lines = body.split(/\r?\n/) - if (!pointlessBumpLinks.some(link => lines[0].includes(link))) { - return false - } - const start = findChangelogStart(lines) - const end = findChangelogEnd(lines, start) - if (!start || !end) { - return false - } - const changelogLines = lines - .slice(start, end) - .filter(line => !line.startsWith(' !line.startsWith('

All notable changes')) - .filter( - line => - !line.startsWith('See '), - ) - .filter(line => !line.startsWith('