generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update .gitignore and refactor main.ts to improve argument parsing an…
…d output formatting
- Loading branch information
Showing
4 changed files
with
32 additions
and
21 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 |
---|---|---|
|
@@ -102,4 +102,6 @@ __tests__/runner/* | |
*.code-workspace | ||
|
||
# TS Docs | ||
docs | ||
docs | ||
|
||
.vscode |
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
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
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { exec } from "@actions/exec"; | ||
import { setFailed } from "@actions/core"; | ||
import { stepResponse } from "src/main"; | ||
import { stepResponse, failedEmoji, passedEmoji } from "src/main"; | ||
|
||
export const formatting = async (): Promise<stepResponse> => { | ||
try { | ||
// Run prettier | ||
await exec("npm run prettier"); | ||
|
||
return { output: "Formatting complete", error: false }; | ||
return { output: `${passedEmoji} - Formatting`, error: false }; | ||
} catch (error) { | ||
if (error instanceof Error) setFailed(error.message); | ||
return { output: "Formatting failed", error: true }; | ||
return { output: `${failedEmoji} - Formatting`, error: true }; | ||
} | ||
}; |