Skip to content

Commit 0f2c514

Browse files
committed
Initial commit for lint
1 parent e3dface commit 0f2c514

File tree

4 files changed

+30
-31
lines changed

4 files changed

+30
-31
lines changed

.prettierrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"printWidth": 80,
3-
"tabWidth": 2,
3+
"tabWidth": 4,
44
"useTabs": false,
5-
"semi": false,
5+
"semi": true,
66
"singleQuote": true,
77
"quoteProps": "as-needed",
88
"jsxSingleQuote": false,
9-
"trailingComma": "none",
9+
"trailingComma": "all",
1010
"bracketSpacing": true,
1111
"bracketSameLine": true,
1212
"arrowParens": "avoid",

src/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* The entrypoint for the action.
33
*/
4-
const { run } = require('./main')
5-
6-
run()
4+
const { run } = require('./main');
5+
run();

src/main.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
const core = require('@actions/core')
2-
const { wait } = require('./wait')
1+
const core = require('@actions/core');
2+
const { wait } = require('./wait');
33

44
/**
55
* The main function for the action.
66
* @returns {Promise<void>} Resolves when the action is complete.
77
*/
88
async function run() {
9-
try {
10-
const ms = core.getInput('milliseconds', { required: true })
9+
try {
10+
const ms = core.getInput('milliseconds', { required: true });
1111

12-
// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
13-
core.debug(`Waiting ${ms} milliseconds ...`)
12+
// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
13+
core.debug(`Waiting ${ms} milliseconds ...`);
1414

15-
// Log the current timestamp, wait, then log the new timestamp
16-
core.debug(new Date().toTimeString())
17-
await wait(parseInt(ms, 10))
18-
core.debug(new Date().toTimeString())
15+
// Log the current timestamp, wait, then log the new timestamp
16+
core.debug(new Date().toTimeString());
17+
await wait(parseInt(ms, 10));
18+
core.debug(new Date().toTimeString());
1919

20-
// Set outputs for other workflow steps to use
21-
core.setOutput('time', new Date().toTimeString())
22-
} catch (error) {
23-
// Fail the workflow run if an error occurs
24-
core.setFailed(error.message)
25-
}
20+
// Set outputs for other workflow steps to use
21+
core.setOutput('time', new Date().toTimeString());
22+
} catch (error) {
23+
// Fail the workflow run if an error occurs
24+
core.setFailed(error.message);
25+
}
2626
}
2727

2828
module.exports = {
29-
run
30-
}
29+
run,
30+
};

src/wait.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* @returns {Promise<string>} Resolves with 'done!' after the wait is over.
66
*/
77
async function wait(milliseconds) {
8-
return new Promise(resolve => {
9-
if (isNaN(milliseconds)) {
10-
throw new Error('milliseconds not a number')
11-
}
8+
return new Promise(resolve => {
9+
if (isNaN(milliseconds)) {
10+
throw new Error('milliseconds not a number');
11+
}
1212

13-
setTimeout(() => resolve('done!'), milliseconds)
14-
})
13+
setTimeout(() => resolve('done!'), milliseconds);
14+
});
1515
}
1616

17-
module.exports = { wait }
17+
module.exports = { wait };

0 commit comments

Comments
 (0)