-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re #96
- Loading branch information
Showing
4 changed files
with
9,890 additions
and
41 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import core from '@actions/core' | ||
|
||
export type Input = | ||
| 'add' | ||
| 'author_name' | ||
| 'author_email' | ||
| 'branch' | ||
| 'cwd' | ||
| 'message' | ||
| 'pull_strategy' | ||
| 'push' | ||
| 'remove' | ||
| 'signoff' | ||
| 'tag' | ||
|
||
export const outputs = { | ||
committed: 'false', | ||
pushed: 'false', | ||
tagged: 'false' | ||
} | ||
export type Output = keyof typeof outputs | ||
|
||
export function getInput(name: Input) { | ||
return core.getInput(name) | ||
} | ||
|
||
export function log(err: any | Error, data?: any) { | ||
if (data) console.log(data) | ||
if (err) core.error(err) | ||
} | ||
|
||
export function parseBool(value: any) { | ||
try { | ||
const parsed = JSON.parse(value) | ||
if (typeof parsed == 'boolean') return parsed | ||
} catch {} | ||
} | ||
|
||
export function setOutput(name: Output, value: 'true' | 'false') { | ||
core.setOutput(name, value) | ||
} | ||
for (const key in outputs) setOutput(key as Output, outputs[key]) |