From 770cf14bde7c39cb2f9decf6bd955fb99c4ecd87 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Tue, 20 Aug 2019 22:15:05 -0700 Subject: [PATCH 1/6] Highlight codeblocks in core/README.md --- packages/core/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/README.md b/packages/core/README.md index f9cc0c35..d60fc5c7 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -8,7 +8,7 @@ You can use this library to get inputs or set outputs: -``` +```js const core = require('@actions/core'); const myInput = core.getInput('inputName', { required: true }); @@ -22,7 +22,7 @@ core.setOutput('outputKey', 'outputVal'); You can also export variables and secrets for future steps. Variables get set in the environment automatically, while secrets must be scoped into the environment from a workflow using `${{ secrets.FOO }}`. Secrets will also be masked from the logs: -``` +```js const core = require('@actions/core'); // Do stuff @@ -45,7 +45,7 @@ core.addPath('pathToTool'); You should use this library to set the failing exit code for your action: -``` +```js const core = require('@actions/core'); try { @@ -62,7 +62,7 @@ catch (err) { Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs). -``` +```js const core = require('@actions/core'); const myInput = core.getInput('input'); From db9fd457701d109a4c06dac4b25129dc52964cb6 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Wed, 21 Aug 2019 01:16:47 -0400 Subject: [PATCH 2/6] Missed one --- packages/core/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/README.md b/packages/core/README.md index d60fc5c7..ade0b6f3 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -35,7 +35,7 @@ core.exportSecret('secretVar', variableWithSecretValue); You can explicitly add items to the path for all remaining steps in a workflow: -``` +```js const core = require('@actions/core'); core.addPath('pathToTool'); From ea2ffbe002698b9d7ce3ab7b18591a4eadf66649 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Wed, 21 Aug 2019 01:16:51 -0400 Subject: [PATCH 3/6] Some more in the docs --- docs/github-package.md | 6 +++--- docs/package-specs.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/github-package.md b/docs/github-package.md index 7b2f3341..8d5cac29 100644 --- a/docs/github-package.md +++ b/docs/github-package.md @@ -8,7 +8,7 @@ Its main purpose will be to provide a hydrated GitHub context/Octokit client wit ##### interfaces.ts -``` +```ts /* * Interfaces */ @@ -56,7 +56,7 @@ export interface WebhookPayloadWithRepository { Contains a GitHub context -``` +```ts export class Context { /** * Webhook payload object that triggered the workflow @@ -89,7 +89,7 @@ export class Context { Contains a hydrated Octokit client -``` +```ts export class GithubClient extends Octokit { // For making GraphQL requests public graphql: (query: string, variables?: Variables) => Promise diff --git a/docs/package-specs.md b/docs/package-specs.md index 712b699e..023c7e85 100644 --- a/docs/package-specs.md +++ b/docs/package-specs.md @@ -6,7 +6,7 @@ In order to support the node-config action, I propose adding the following into Holds all the functions necessary for interacting with the runner/environment. -``` +```ts // Logging functions export function debug(message: string): void export function warning(message: string): void @@ -66,7 +66,7 @@ export function setFailed(message: string): void Holds all the functions necessary for file system manipulation (cli scenarios, not fs replacements): -``` +```ts /** * Interface for cp/mv options */ @@ -132,7 +132,7 @@ export function which(tool: string, options?: WhichOptions): Promise Holds all the functions necessary for running the tools node-config depends on (aka 7-zip and tar) -``` +```ts /** * Interface for exec options */ @@ -155,7 +155,7 @@ export function exec(commandLine: string, args?: string[], options?: IExecOption Holds all the functions necessary for downloading and caching node. -``` +```ts /** * Download a tool from an url and stream it into a file * From 5e3e440c7f440ff419bf8071b5d39cc5b3933c08 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Wed, 21 Aug 2019 01:18:00 -0400 Subject: [PATCH 4/6] exec/README.md --- packages/exec/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/exec/README.md b/packages/exec/README.md index e76ce0b5..84f8c8c6 100644 --- a/packages/exec/README.md +++ b/packages/exec/README.md @@ -6,7 +6,7 @@ You can use this package to execute your tools on the command line in a cross platform way: -``` +```js const exec = require('@actions/exec'); await exec.exec('node index.js'); @@ -16,7 +16,7 @@ await exec.exec('node index.js'); You can also pass in arg arrays: -``` +```js const exec = require('@actions/exec'); await exec.exec('node', ['index.js', 'foo=bar']); @@ -26,7 +26,7 @@ await exec.exec('node', ['index.js', 'foo=bar']); Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5): -``` +```js const exec = require('@actions/exec'); const myOutput = ''; @@ -50,7 +50,7 @@ await exec.exec('node', ['index.js', 'foo=bar'], options); You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH: -``` +```js const exec = require('@actions/exec'); const io = require('@actions/io'); From a796c65f641dc25c3f75c8b21d2277ffeff503e2 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Wed, 21 Aug 2019 01:18:21 -0400 Subject: [PATCH 5/6] io/README.md --- packages/io/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/io/README.md b/packages/io/README.md index 22f0901d..9aadf2f9 100644 --- a/packages/io/README.md +++ b/packages/io/README.md @@ -8,7 +8,7 @@ Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified: -``` +```js const io = require('@actions/io'); await io.mkdirP('path/to/make'); @@ -18,7 +18,7 @@ await io.mkdirP('path/to/make'); Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv): -``` +```js const io = require('@actions/io'); // Recursive must be true for directories @@ -32,7 +32,7 @@ await io.mv('path/to/file', 'path/to/dest'); Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified. -``` +```js const io = require('@actions/io'); await io.rmRF('path/to/directory'); @@ -43,7 +43,7 @@ await io.rmRF('path/to/file'); Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which). -``` +```js const exec = require('@actions/exec'); const io = require('@actions/io'); From 1d687b2170f6b6282e246c6183fa3dc8eca8daf5 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Wed, 21 Aug 2019 01:18:31 -0400 Subject: [PATCH 6/6] tool-cache/README.md --- packages/tool-cache/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/tool-cache/README.md b/packages/tool-cache/README.md index 56c53530..4c360ba9 100644 --- a/packages/tool-cache/README.md +++ b/packages/tool-cache/README.md @@ -8,7 +8,7 @@ You can use this to download tools (or other files) from a download URL: -``` +```js const tc = require('@actions/tool-cache'); const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); @@ -18,7 +18,7 @@ const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v1 These can then be extracted in platform specific ways: -``` +```js const tc = require('@actions/tool-cache'); if (process.platform === 'win32') { @@ -41,7 +41,7 @@ Finally, you can cache these directories in our tool-cache. This is useful if yo You'll often want to add it to the path as part of this step: -``` +```js const tc = require('@actions/tool-cache'); const core = require('@actions/core'); @@ -54,7 +54,7 @@ core.addPath(cachedPath); You can also cache files for reuse. -``` +```js const tc = require('@actions/tool-cache'); tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0'); @@ -64,7 +64,7 @@ tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0'); Finally, you can find directories and files you've previously cached: -``` +```js const tc = require('@actions/tool-cache'); const core = require('@actions/core'); @@ -74,7 +74,7 @@ core.addPath(nodeDirectory); You can even find all cached versions of a tool: -``` +```js const tc = require('@actions/tool-cache'); const allNodeVersions = tc.findAllVersions('node');