diff options
| author | ST-DDT <[email protected]> | 2024-11-09 11:14:08 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-09 11:14:08 +0100 |
| commit | 519d212faec4ac4269693f060d7f8ff5e3dab94c (patch) | |
| tree | 0aff8ef843ee5ad510ca5ee4e93ac477a52c9e40 | |
| parent | 525fedc91bd02f53330cfb40fe228b148dcf562b (diff) | |
| download | faker-519d212faec4ac4269693f060d7f8ff5e3dab94c.tar.xz faker-519d212faec4ac4269693f060d7f8ff5e3dab94c.zip | |
infra: remove preflight failure comment (#3188)
| -rw-r--r-- | .github/workflows/commentCodeGeneration.ts | 73 | ||||
| -rw-r--r-- | .github/workflows/pr.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/preflight-comment.yml | 45 | ||||
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | pnpm-lock.yaml | 162 |
5 files changed, 1 insertions, 282 deletions
diff --git a/.github/workflows/commentCodeGeneration.ts b/.github/workflows/commentCodeGeneration.ts deleted file mode 100644 index 2e8a115c..00000000 --- a/.github/workflows/commentCodeGeneration.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { context as ctx, GitHub } from '@actions/github/lib/utils'; - -/** - * Notifies the PR about uncommitted changes generated by the `generate:*` commands. - * - * This script is used by github-script - * https://github.com/actions/github-script - * - * @param github A pre-authenticated octokit/rest.js client with pagination plugins - * @param context An object containing the context of the workflow run. - */ -export async function script( - github: InstanceType<typeof GitHub>, - context: typeof ctx -): Promise<void> { - const repoArgs = { owner: context.repo.owner, repo: context.repo.repo }; - - // Identify the PR that triggered the workflow - const head_branch: string = context.payload.workflow_run.head_branch; - const { data: prs } = await github.rest.pulls.list({ - ...repoArgs, - state: 'open', - head: head_branch, - }); - - if (prs.length === 0) { - console.log(`No PRs found for branch ${head_branch}`); - return; - } - - const pr_number = prs[0].number; - - // Check if the PR already has a comment from the bot - - const { data: comments } = await github.rest.issues.listComments({ - ...repoArgs, - issue_number: pr_number, - }); - - const body = `GitHub Actions has found some problems running the preflight checks. - -Please make sure to: - -- run \`pnpm run preflight\` locally -- fix all issues until the command completes without errors -- commit and push the changes -`; - - const botComment = comments.find( - (comment) => comment.user?.type === 'Bot' && comment.body?.includes(body) - ); - - const isSuccess = context.payload.workflow_run.conclusion === 'success'; - - if (isSuccess) { - // Delete the bot comment if present - if (botComment != null) { - await github.rest.issues.deleteComment({ - ...repoArgs, - comment_id: botComment.id, - }); - } - } else { - // Create the comment if missing - if (botComment == null) { - await github.rest.issues.createComment({ - ...repoArgs, - issue_number: pr_number, - body, - }); - } - } -} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 26b3967c..25c7cf5d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,8 +11,8 @@ jobs: check-code-generation: runs-on: ubuntu-latest timeout-minutes: 10 - name: 'Check Code Generation: node-22, ubuntu-latest' + name: 'Check Code Generation: node-22, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/preflight-comment.yml b/.github/workflows/preflight-comment.yml deleted file mode 100644 index ec25271c..00000000 --- a/.github/workflows/preflight-comment.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Preflight Comment - -on: - workflow_run: - workflows: 'PR' - types: - - completed - -permissions: - pull-requests: write - -jobs: - comment-code-generation: - runs-on: ubuntu-latest - timeout-minutes: 5 - name: 'Comment Code Generation' - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: 'next' - - - name: Install pnpm - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - name: Set node version to 22 - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version: 22 - cache: 'pnpm' - - - name: Install deps - run: pnpm install - env: - CYPRESS_INSTALL_BINARY: 0 - - - name: Transpile ts - run: pnpm tsup-node .github/workflows/commentCodeGeneration.ts --format cjs --clean false --out-dir .github/workflows - - - name: Comment - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - const { script } = require('${{ github.workspace }}/.github/workflows/commentCodeGeneration.cjs') - await script(github, context) diff --git a/package.json b/package.json index 0a2fa2a8..e193e629 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,6 @@ "dist" ], "devDependencies": { - "@actions/github": "6.0.0", "@eslint/compat": "1.2.2", "@eslint/js": "9.14.0", "@stylistic/eslint-plugin": "2.10.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 125d537b..ba9e0ef4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ importers: .: devDependencies: - '@actions/github': - specifier: 6.0.0 - version: 6.0.0 '@eslint/compat': specifier: 1.2.2 version: 1.2.2([email protected]([email protected])) @@ -128,12 +125,6 @@ importers: packages: - '@actions/[email protected]': - resolution: {integrity: sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==} - - '@actions/[email protected]': - resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==} - '@algolia/[email protected]': resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} @@ -747,10 +738,6 @@ packages: resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@fastify/[email protected]': - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} - engines: {node: '>=14'} - '@humanfs/[email protected]': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -813,54 +800,6 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@octokit/[email protected]': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/[email protected]': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/[email protected]': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/[email protected]': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/[email protected]': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/[email protected]': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/[email protected]': - resolution: {integrity: sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==} - '@pkgjs/[email protected]': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1403,9 +1342,6 @@ packages: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} @@ -1775,9 +1711,6 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -3430,10 +3363,6 @@ packages: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} @@ -3482,10 +3411,6 @@ packages: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} - engines: {node: '>=14.0'} - resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} @@ -3501,9 +3426,6 @@ packages: resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} @@ -3772,18 +3694,6 @@ packages: snapshots: - '@actions/[email protected]': - dependencies: - '@actions/http-client': 2.2.3 - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/[email protected]) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/[email protected]) - - '@actions/[email protected]': - dependencies: - tunnel: 0.0.6 - undici: 5.28.4 - dependencies: '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/[email protected])([email protected])([email protected]) @@ -4237,8 +4147,6 @@ snapshots: dependencies: levn: 0.4.1 - '@fastify/[email protected]': {} - '@humanfs/[email protected]': {} '@humanfs/[email protected]': @@ -4294,64 +4202,6 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@octokit/[email protected]': {} - - '@octokit/[email protected]': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.6.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/[email protected]': - dependencies: - '@octokit/types': 13.6.1 - universal-user-agent: 6.0.1 - - '@octokit/[email protected]': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.6.1 - universal-user-agent: 6.0.1 - - '@octokit/[email protected]': {} - - '@octokit/[email protected]': {} - - '@octokit/[email protected](@octokit/[email protected])': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/[email protected](@octokit/[email protected])': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/[email protected]': - dependencies: - '@octokit/types': 13.6.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/[email protected]': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.6.1 - universal-user-agent: 6.0.1 - - '@octokit/[email protected]': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/[email protected]': - dependencies: - '@octokit/openapi-types': 22.2.0 - '@pkgjs/[email protected]': optional: true @@ -4927,8 +4777,6 @@ snapshots: dependencies: tweetnacl: 0.14.5 - [email protected]: {} - @@ -5347,8 +5195,6 @@ snapshots: - [email protected]: {} - @@ -7095,8 +6941,6 @@ snapshots: dependencies: safe-buffer: 5.2.1 - [email protected]: {} - @@ -7131,10 +6975,6 @@ snapshots: - dependencies: - '@fastify/busboy': 2.1.1 - dependencies: '@types/unist': 3.0.3 @@ -7158,8 +6998,6 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 - [email protected]: {} - |
