Skip to content

Commit

Permalink
update doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
tingluohuang-test committed Oct 3, 2019
1 parent 81b71dc commit 5ce4932
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```

0 comments on commit 5ce4932

Please sign in to comment.