From 38023a445dda4d6b940543f84f7db0a4eff17550 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:23:24 -0400 Subject: [PATCH 01/12] Upgrading to node 16 for workflows, updating regex --- .github/workflows/data-validate.yml | 2 +- .github/workflows/populate-readme.yml | 2 +- server.ts | 6 +++++- src/data.js | 24 ++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/data-validate.yml b/.github/workflows/data-validate.yml index 9b312fcd..81e20dc8 100644 --- a/.github/workflows/data-validate.yml +++ b/.github/workflows/data-validate.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: 13.x + node-version: 16.x - name: Cache/Restore node modules uses: actions/cache@v1 diff --git a/.github/workflows/populate-readme.yml b/.github/workflows/populate-readme.yml index f9885179..f9f3305d 100644 --- a/.github/workflows/populate-readme.yml +++ b/.github/workflows/populate-readme.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: 13.x + node-version: 16.x - name: Cache/Restore node modules uses: actions/cache@v1 diff --git a/server.ts b/server.ts index f61ecde4..97602293 100644 --- a/server.ts +++ b/server.ts @@ -12,5 +12,9 @@ export const config = { cache: "manual", path: "/*", // Pass all assets to the netlify asset server - excluded_patterns: ["/_assets/*", "/_shared/*", "/**/*.js"], + excluded_patterns: [ + '^\\/_assets\\/[^\\/]*$', + '^\\/shared\\/[^\\/]*$', + '^\\/**\\/[^\\/]*$', + ], }; diff --git a/src/data.js b/src/data.js index 2cee161d..de2ee2e3 100644 --- a/src/data.js +++ b/src/data.js @@ -21,6 +21,30 @@ * Keep this a commonjs export. */ module.exports = [ + { + name: 'Vladimir Vo', + description: 'Frontend developer with passion for great product design', + url: 'https://vldmr.website/uses', + twitter: '@v1in_', + emoji: '🖖', + country: '🇵🇱', + computer: 'apple', + phone: 'iphone', + tags: [ + 'Astro', + 'Front End', + 'Developer', + 'JavaScript', + 'TypeScript', + 'React', + 'Next', + 'JAMstack', + 'Netlify', + 'Vercel', + 'HTML', + 'CSS', + ], + }, { name: 'uncenter', description: 'Very incompetent developer', From 6a21f998645dbd5ee0940a2c34e6cf0ef5f7be07 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:36:37 -0400 Subject: [PATCH 02/12] Updating util with actions 5.1 --- scripts/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 9088ead8..803c9839 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -111,6 +111,7 @@ module.exports.communicateValidationOutcome = async function ( ].join('\n'); } + const { GITHUB_TOKEN } = process.env; const { context } = github; if (!GITHUB_TOKEN || !context.payload.pull_request) { @@ -123,7 +124,8 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; - const octokit = new github.GitHub(GITHUB_TOKEN); + const github = require('@actions/github'); + const octokit = new github.getOctokit(GITHUB_TOKEN); await octokit.issues.createComment({ ...context.repo, issue_number: pullRequestNumber, From 9dafb83692ce47e878e00690228749c65dda9d6c Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:39:13 -0400 Subject: [PATCH 03/12] Fixing github import --- scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 803c9839..f7c930d4 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -5,6 +5,7 @@ const Joi = require('joi'); const http = require('http'); const https = require('https'); const flags = require('./flags.js'); +const github = require('@actions/github'); async function getCurrentBranchName() { let myOutput = ''; @@ -124,7 +125,6 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; - const github = require('@actions/github'); const octokit = new github.getOctokit(GITHUB_TOKEN); await octokit.issues.createComment({ ...context.repo, From 1a30aa3181d8a8e1a6fcd98c66f3eaceea5f4fa2 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:41:56 -0400 Subject: [PATCH 04/12] Imported actions twice :( --- scripts/utils.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index f7c930d4..4a1bcbf3 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -5,7 +5,6 @@ const Joi = require('joi'); const http = require('http'); const https = require('https'); const flags = require('./flags.js'); -const github = require('@actions/github'); async function getCurrentBranchName() { let myOutput = ''; From eb833a93a2fd97097c959ab86ab160a9332c0f9b Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:45:52 -0400 Subject: [PATCH 05/12] Updating create comment --- scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 4a1bcbf3..8b608239 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -125,7 +125,7 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; const octokit = new github.getOctokit(GITHUB_TOKEN); - await octokit.issues.createComment({ + await octokit.rest.issues.createComment({ ...context.repo, issue_number: pullRequestNumber, body: comment, From 9011d646276ea5bad258b440dff179ba6eabfd95 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:56:22 -0400 Subject: [PATCH 06/12] Using pulls instead of issues --- scripts/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 8b608239..b952f325 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -125,9 +125,9 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; const octokit = new github.getOctokit(GITHUB_TOKEN); - await octokit.rest.issues.createComment({ + await octokit.rest.pulls.createComment({ ...context.repo, - issue_number: pullRequestNumber, + pullRequestNumber, body: comment, }); }; From a99648b25ce973f2ec2a9af6ac4da5227096b6bc Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Wed, 29 Mar 2023 01:58:31 -0400 Subject: [PATCH 07/12] Adding review comment --- scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index b952f325..407b25c4 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -125,7 +125,7 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; const octokit = new github.getOctokit(GITHUB_TOKEN); - await octokit.rest.pulls.createComment({ + await octokit.rest.pulls.createReviewComment({ ...context.repo, pullRequestNumber, body: comment, From 96772328a8f0e0eb6e99403b838022f240496b44 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Tue, 11 Apr 2023 22:41:48 -0400 Subject: [PATCH 08/12] adding logging --- scripts/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/utils.js b/scripts/utils.js index 407b25c4..84ce71cc 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -123,6 +123,9 @@ module.exports.communicateValidationOutcome = async function ( } const pullRequestNumber = context.payload.pull_request.number; + console.log('pullRequestNumber', pullRequestNumber); + console.log('pullRequestNumber', context.payload.pull_request); + const octokit = new github.getOctokit(GITHUB_TOKEN); await octokit.rest.pulls.createReviewComment({ From b100f8dd6e919ccf3d48bcdc21801bb4e138812c Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Tue, 11 Apr 2023 22:47:04 -0400 Subject: [PATCH 09/12] adding more logging --- scripts/utils.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 84ce71cc..1cb62069 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -124,7 +124,14 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; console.log('pullRequestNumber', pullRequestNumber); - console.log('pullRequestNumber', context.payload.pull_request); + console.log('repo full', ...context.repo); + // log owner + console.log('owner', context.repo.owner); + // repo name + console.log('repo', context.repo.repo); + // body + console.log('body', comment); + const octokit = new github.getOctokit(GITHUB_TOKEN); From cd6168908a0d31fdaf8997da545582f86380e8d9 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Tue, 11 Apr 2023 22:49:36 -0400 Subject: [PATCH 10/12] updating logging --- scripts/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/utils.js b/scripts/utils.js index 1cb62069..7560f932 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -124,7 +124,9 @@ module.exports.communicateValidationOutcome = async function ( const pullRequestNumber = context.payload.pull_request.number; console.log('pullRequestNumber', pullRequestNumber); - console.log('repo full', ...context.repo); + console.log('context', context); + + console.log('repo full', context.repo); // log owner console.log('owner', context.repo.owner); // repo name From b96d3ddaa3edb56105177413ac89c36c0e5d97b1 Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Tue, 11 Apr 2023 23:03:50 -0400 Subject: [PATCH 11/12] Disabling comments for testing --- scripts/utils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 7560f932..8435a1a1 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -136,10 +136,10 @@ module.exports.communicateValidationOutcome = async function ( - const octokit = new github.getOctokit(GITHUB_TOKEN); - await octokit.rest.pulls.createReviewComment({ - ...context.repo, - pullRequestNumber, - body: comment, - }); + // const octokit = new github.getOctokit(GITHUB_TOKEN); + // await octokit.rest.pulls.createReviewComment({ + // ...context.repo, + // pullRequestNumber, + // body: comment, + // }); }; From d756814e6f49ad40e35f6bc215e7ce3e053e366b Mon Sep 17 00:00:00 2001 From: Blake Campbell Date: Tue, 11 Apr 2023 23:06:22 -0400 Subject: [PATCH 12/12] Disabling create review comment temporarily. --- scripts/utils.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 8435a1a1..2aa0fd8a 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -121,20 +121,8 @@ module.exports.communicateValidationOutcome = async function ( core.info(`Comment contents:\n${comment}`); return; } - - const pullRequestNumber = context.payload.pull_request.number; - console.log('pullRequestNumber', pullRequestNumber); - console.log('context', context); - - console.log('repo full', context.repo); - // log owner - console.log('owner', context.repo.owner); - // repo name - console.log('repo', context.repo.repo); - // body - console.log('body', comment); - - + // TODO: Re-enable a way to comment on PRs that tests passed. + // const pullRequestNumber = context.payload.pull_request.number; // const octokit = new github.getOctokit(GITHUB_TOKEN); // await octokit.rest.pulls.createReviewComment({