Skip to content

Commit

Permalink
lint(prettier): trailingComma preferred as all vs none
Browse files Browse the repository at this point in the history
Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
mikehardy and styfle committed Apr 11, 2021
1 parent accbea4 commit 30eb876
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Expand Up @@ -4,7 +4,7 @@
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"parser": "typescript"
Expand Down
14 changes: 7 additions & 7 deletions src/index.ts
Expand Up @@ -15,7 +15,7 @@ async function main() {
sha,
ref,
repo: { owner, repo },
payload
payload,
} = github.context;
const { GITHUB_RUN_ID } = process.env;

Expand All @@ -40,7 +40,7 @@ async function main() {
const { data: current_run } = await octokit.actions.getWorkflowRun({
owner,
repo,
run_id: Number(GITHUB_RUN_ID)
run_id: Number(GITHUB_RUN_ID),
});

if (workflow_id) {
Expand All @@ -64,20 +64,20 @@ async function main() {
repo,
// @ts-ignore
workflow_id,
branch
branch,
});

const branchWorkflows = data.workflow_runs.filter(run => run.head_branch === branch);
console.log(
`Found ${branchWorkflows.length} runs for workflow ${workflow_id} on branch ${branch}`
`Found ${branchWorkflows.length} runs for workflow ${workflow_id} on branch ${branch}`,
);
console.log(branchWorkflows.map(run => `- ${run.html_url}`).join('\n'));

const runningWorkflows = branchWorkflows.filter(
run =>
(ignore_sha || run.head_sha !== headSha) &&
run.status !== 'completed' &&
new Date(run.created_at) < new Date(current_run.created_at)
new Date(run.created_at) < new Date(current_run.created_at),
);
console.log(`with ${runningWorkflows.length} runs to cancel.`);

Expand All @@ -86,7 +86,7 @@ async function main() {
const res = await octokit.actions.cancelWorkflowRun({
owner,
repo,
run_id: id
run_id: id,
});
console.log(`Cancel run ${id} responded with status ${res.status}`);
}
Expand All @@ -95,7 +95,7 @@ async function main() {
console.log(`Error while canceling workflow_id ${workflow_id}: ${msg}`);
}
console.log('');
})
}),
);
}

Expand Down

0 comments on commit 30eb876

Please sign in to comment.