-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from UlisesGascon/fix/linting
chore: linting
- Loading branch information
Showing
3 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19905,7 +19905,7 @@ const generateScores = async ({ scope, database: currentDatabase, maxRequestInPa | |
|
||
for (let index = 0; index < chunks.length; index++) { | ||
const chunk = chunks[index] | ||
core.debug(`Processing chunk ${index+1}/${chunks.length}`) | ||
core.debug(`Processing chunk ${index + 1}/${chunks.length}`) | ||
|
||
const chunkScores = await Promise.all(chunk.map(async ({ org, repo }) => { | ||
const { score, date } = await getProjectScore({ platform, org, repo }) | ||
|
@@ -19935,7 +19935,7 @@ const generateScores = async ({ scope, database: currentDatabase, maxRequestInPa | |
scores.push(...chunkScores) | ||
} | ||
|
||
core.debug(`All the scores are already collected`) | ||
core.debug('All the scores are already collected') | ||
|
||
const reportContent = await generateReportContent(scores) | ||
const issueContent = await generateIssueContent(scores) | ||
|
@@ -20307,25 +20307,25 @@ async function run () { | |
octokit = github.getOctokit(githubToken) | ||
} | ||
|
||
core.info("Checking Scope...") | ||
core.info('Checking Scope...') | ||
const scope = await readFile(scopePath, 'utf8').then(content => JSON.parse(content)) | ||
let database = {} | ||
|
||
// Check if database exists | ||
try { | ||
core.info("Checking if database exists...") | ||
core.info('Checking if database exists...') | ||
await stat(databasePath) | ||
database = await readFile(databasePath, 'utf8').then(content => JSON.parse(content)) | ||
} catch (error) { | ||
core.info('Database does not exist, creating new database') | ||
} | ||
|
||
// PROCESS | ||
core.info("Generating scores...") | ||
core.info('Generating scores...') | ||
const { reportContent, issueContent, database: newDatabaseState } = await generateScores({ scope, database, maxRequestInParallel }) | ||
|
||
// @TODO: If no changes to database, skip the rest of the process | ||
core.info("Checking database changes...") | ||
core.info('Checking database changes...') | ||
const hasChanges = isDifferentContent(database, newDatabaseState) | ||
|
||
if (!hasChanges) { | ||
|
@@ -20334,14 +20334,14 @@ async function run () { | |
} | ||
|
||
// Save changes | ||
core.info("Saving changes to database and report") | ||
core.info('Saving changes to database and report') | ||
await writeFile(databasePath, JSON.stringify(newDatabaseState, null, 2)) | ||
await writeFile(reportPath, reportContent) | ||
|
||
// Commit changes | ||
// @see: https://github.com/actions/checkout#push-a-commit-using-the-built-in-token | ||
if (autoCommit) { | ||
core.info("Committing changes to database and report") | ||
core.info('Committing changes to database and report') | ||
await exec.exec('git config user.name github-actions') | ||
await exec.exec('git config user.email [email protected]') | ||
await exec.exec(`git add ${databasePath}`) | ||
|
@@ -20352,14 +20352,14 @@ async function run () { | |
// Push changes | ||
if (autoPush) { | ||
// @see: https://github.com/actions-js/push/blob/master/start.sh#L43 | ||
core.info("Pushing changes to database and report") | ||
core.info('Pushing changes to database and report') | ||
const remoteRepo = `https://${process.env.INPUT_GITHUB_ACTOR}:${githubToken}@github.com/${process.env.INPUT_REPOSITORY}.git` | ||
await exec.exec(`git push origin ${process.env.GITHUB_HEAD_REF} --force --no-verify --repo ${remoteRepo}`) | ||
} | ||
|
||
// Issue creation | ||
if (generateIssue && issueContent) { | ||
core.info("Creating issue...") | ||
core.info('Creating issue...') | ||
await octokit.rest.issues.create({ | ||
...context.repo, | ||
title: issueTitle, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,25 +34,25 @@ async function run () { | |
octokit = github.getOctokit(githubToken) | ||
} | ||
|
||
core.info("Checking Scope...") | ||
core.info('Checking Scope...') | ||
const scope = await readFile(scopePath, 'utf8').then(content => JSON.parse(content)) | ||
let database = {} | ||
|
||
// Check if database exists | ||
try { | ||
core.info("Checking if database exists...") | ||
core.info('Checking if database exists...') | ||
await stat(databasePath) | ||
database = await readFile(databasePath, 'utf8').then(content => JSON.parse(content)) | ||
} catch (error) { | ||
core.info('Database does not exist, creating new database') | ||
} | ||
|
||
// PROCESS | ||
core.info("Generating scores...") | ||
core.info('Generating scores...') | ||
const { reportContent, issueContent, database: newDatabaseState } = await generateScores({ scope, database, maxRequestInParallel }) | ||
|
||
// @TODO: If no changes to database, skip the rest of the process | ||
core.info("Checking database changes...") | ||
core.info('Checking database changes...') | ||
const hasChanges = isDifferentContent(database, newDatabaseState) | ||
|
||
if (!hasChanges) { | ||
|
@@ -61,14 +61,14 @@ async function run () { | |
} | ||
|
||
// Save changes | ||
core.info("Saving changes to database and report") | ||
core.info('Saving changes to database and report') | ||
await writeFile(databasePath, JSON.stringify(newDatabaseState, null, 2)) | ||
await writeFile(reportPath, reportContent) | ||
|
||
// Commit changes | ||
// @see: https://github.com/actions/checkout#push-a-commit-using-the-built-in-token | ||
if (autoCommit) { | ||
core.info("Committing changes to database and report") | ||
core.info('Committing changes to database and report') | ||
await exec.exec('git config user.name github-actions') | ||
await exec.exec('git config user.email [email protected]') | ||
await exec.exec(`git add ${databasePath}`) | ||
|
@@ -79,14 +79,14 @@ async function run () { | |
// Push changes | ||
if (autoPush) { | ||
// @see: https://github.com/actions-js/push/blob/master/start.sh#L43 | ||
core.info("Pushing changes to database and report") | ||
core.info('Pushing changes to database and report') | ||
const remoteRepo = `https://${process.env.INPUT_GITHUB_ACTOR}:${githubToken}@github.com/${process.env.INPUT_REPOSITORY}.git` | ||
await exec.exec(`git push origin ${process.env.GITHUB_HEAD_REF} --force --no-verify --repo ${remoteRepo}`) | ||
} | ||
|
||
// Issue creation | ||
if (generateIssue && issueContent) { | ||
core.info("Creating issue...") | ||
core.info('Creating issue...') | ||
await octokit.rest.issues.create({ | ||
...context.repo, | ||
title: issueTitle, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters