diff --git a/packages/core/README.md b/packages/core/README.md index 58a8287f..46e405f2 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -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); ``` \ No newline at end of file