mirror of https://github.com/actions/toolkit
Highlight codeblocks in core/README.md
parent
00fc8b2580
commit
770cf14bde
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
You can use this library to get inputs or set outputs:
|
You can use this library to get inputs or set outputs:
|
||||||
|
|
||||||
```
|
```js
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
|
||||||
const myInput = core.getInput('inputName', { required: true });
|
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:
|
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');
|
const core = require('@actions/core');
|
||||||
|
|
||||||
// Do stuff
|
// Do stuff
|
||||||
|
@ -45,7 +45,7 @@ core.addPath('pathToTool');
|
||||||
|
|
||||||
You should use this library to set the failing exit code for your action:
|
You should use this library to set the failing exit code for your action:
|
||||||
|
|
||||||
```
|
```js
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
|
||||||
try {
|
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).
|
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 core = require('@actions/core');
|
||||||
|
|
||||||
const myInput = core.getInput('input');
|
const myInput = core.getInput('input');
|
||||||
|
|
Loading…
Reference in New Issue