generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.4.0 - support local execution with act + allow tags (#40)
* Avoid code repetition with exec() and output listeners * Improve behavior for new branches and when it's running in ACT * Detect parent commit only if needed * Fix parent commit detection for initial commit * Improve logging * Improve current ref detection * Fix issue when base is a already fetched tag * Fix issue when base is a already fetched tag * Update README * Document usage with act * Use `git log` to get changes in latest commit * Disable other output for `git log` * get short name from base ref + improve loggig * update CHANGELOG
- Loading branch information
Showing
7 changed files
with
292 additions
and
144 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
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
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,21 @@ | ||
import {exec as execImpl, ExecOptions} from '@actions/exec' | ||
|
||
// Wraps original exec() function | ||
// Returns exit code and whole stdout/stderr | ||
export default async function exec(commandLine: string, args?: string[], options?: ExecOptions): Promise<ExecResult> { | ||
options = options || {} | ||
let stdout = '' | ||
let stderr = '' | ||
options.listeners = { | ||
stdout: (data: Buffer) => (stdout += data.toString()), | ||
stderr: (data: Buffer) => (stderr += data.toString()) | ||
} | ||
const code = await execImpl(commandLine, args, options) | ||
return {code, stdout, stderr} | ||
} | ||
|
||
export interface ExecResult { | ||
code: number | ||
stdout: string | ||
stderr: string | ||
} |
Oops, something went wrong.