Add group functions to core

This commit is contained in:
Jonathan Clem
2019-08-28 22:35:27 -04:00
parent e35e0e640b
commit 8b9dfa809b
4 changed files with 72 additions and 1 deletions

View File

@@ -78,3 +78,20 @@ catch (err) {
core.error(`Error ${err}, action may still succeed though`);
}
```
This library can also wrap chunks of output in foldable groups.
```js
const core = require('@actions/core')
// Manually wrap output
core.groupStart('Do some function')
doSomeFunction()
core.groupEnd()
// Wrap an asynchronous function call
const result = await core.group('Do something async', async () => {
const response = await doSomeHTTPRequest()
return response
})
```