1
0
Fork 0

update doc.

pull/149/head
Tingluo Huang 2019-10-03 00:41:30 -04:00
parent 81b71dc6e6
commit 5ce4932391
1 changed files with 33 additions and 0 deletions

View File

@ -94,4 +94,37 @@ const result = await core.group('Do something async', async () => {
const response = await doSomeHTTPRequest()
return response
})
```
#### Action state
You can use this library to save state and get state for sharing information between a given wrapper action:
**action.yml**
```yaml
name: 'Wrapper action sample'
inputs:
name:
default: 'GitHub'
runs:
using: 'node12'
main: 'main.js'
post: 'cleanup.js'
```
In action's `main.js`:
```js
const core = require('@actions/core');
core.saveState("pidToKill", 12345);
```
In action's `cleanup.js`:
```js
const core = require('@actions/core');
var pid = core.getState("pidToKill");
kill(pid);
```