Compare commits

..
16 Commits
Author SHA1 Message Date
Jonathan Clem 5d03ada4b0 0.9.0 2020-03-24 15:14:05 -04:00
Jonathan Clem 293ee0ca2d Uninstall/reinstall ts-jest 2020-03-24 15:07:44 -04:00
Jonathan Clem 67d29bab15 Merge pull request #36 from actions/bump-dependencies
Uninstall/reinstall Jest (for minimist update)
2020-03-24 15:00:02 -04:00
Jonathan Clem 0baa1791ca Merge pull request #35 from actions/bump-dependencies
Bump outdated npm packages
2020-03-24 14:58:02 -04:00
Jonathan Clem b4fd05ccdf Uninstall/reinstall Jest (for minimist update) 2020-03-24 14:57:31 -04:00
Jonathan Clem 2ccd1edaf4 Update ncc 2020-03-24 14:38:07 -04:00
Jonathan Clem a59996ab35 Update TypeScript 2020-03-24 14:37:22 -04:00
Jonathan Clem 7ca8635cd0 Bump @types/jest 2020-03-24 14:36:26 -04:00
Jonathan Clem 8117de6119 Bump @actions/core 2020-03-24 14:35:48 -04:00
Jonathan Clem 3f4f5a83e8 Merge pull request #34 from actions/dependabot/npm_and_yarn/acorn-6.4.1
Bump acorn from 6.4.0 to 6.4.1
2020-03-24 14:14:58 -04:00
dependabot[bot] 0e2c0d5c7c Bump acorn from 6.4.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <[email protected]>
2020-03-24 18:11:43 +00:00
Jonathan Clem 0d15461bee Merge pull request #33 from actions/add-core
Add core to execution context
2020-03-24 14:08:04 -04:00
Jonathan Clem e4cc5a8d47 Add core to README 2020-03-24 14:06:45 -04:00
Jonathan Clem dc16f26602 Add core to integration test 2020-03-24 14:02:45 -04:00
Jonathan Clem 8982156783 Add core to the script context 2020-03-24 13:57:27 -04:00
Jonathan Clem 80a5e943b4 v0.8.0 2020-02-28 09:18:07 -05:00
6 changed files with 236 additions and 131 deletions
+3 -2
View File
@@ -8,9 +8,10 @@ jobs:
- id: output-set - id: output-set
uses: actions/github-script@master uses: actions/github-script@master
with: with:
script: return 'test' script: return core.getInput('input-value')
result-encoding: string result-encoding: string
input-value: output
- run: | - run: |
if [[ "${{steps.output-set.outputs.result}}" != "test" ]]; then if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then
exit 1 exit 1
fi fi
+8 -9
View File
@@ -11,6 +11,7 @@ be provided:
[octokit/rest.js](https://github.com/octokit/rest.js) client [octokit/rest.js](https://github.com/octokit/rest.js) client
- `context` An object containing the [context of the workflow - `context` An object containing the [context of the workflow
run](https://github.com/actions/toolkit/tree/master/packages/github) run](https://github.com/actions/toolkit/tree/master/packages/github)
- `core` A reference to the [@actions/core](https://github.com/actions/toolkit/tree/master/packages/core) package
Since the `script` is just a function body, these values will already be Since the `script` is just a function body, these values will already be
defined, so you don't have to (see examples below). defined, so you don't have to (see examples below).
@@ -19,7 +20,7 @@ See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client
documentation. documentation.
**Note** This action is still a bit of an experiment—the API may change in **Note** This action is still a bit of an experiment—the API may change in
*future versions. 🙂 future versions. 🙂
## Development ## Development
@@ -42,7 +43,7 @@ jobs:
comment: comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@0.6.0 - uses: actions/github-script@0.9.0
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
@@ -64,7 +65,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@0.6.0 - uses: actions/github-script@0.9.0
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
@@ -85,7 +86,7 @@ jobs:
welcome: welcome:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@0.6.0 - uses: actions/github-script@0.9.0
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
@@ -123,14 +124,13 @@ You can use the `github` object to access the Octokit API. For
instance, `github.request` instance, `github.request`
```yaml ```yaml
on: on: pull_request
pull_request
jobs: jobs:
diff: diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@0.6.0 - uses: actions/github-script@0.9.0
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
@@ -148,9 +148,8 @@ By default, the JSON-encoded return value of the function is set as the "result"
output of a github-script step. For some workflows, string encoding is preferred. This option can be set using the output of a github-script step. For some workflows, string encoding is preferred. This option can be set using the
`result-encoding` input: `result-encoding` input:
```yaml ```yaml
- uses: actions/github-script@0.6.0 - uses: actions/github-script@0.9.0
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string result-encoding: string
+10 -3
View File
@@ -298,9 +298,9 @@ module.exports = require("tls");
/***/ }), /***/ }),
/***/ 18: /***/ 18:
/***/ (function() { /***/ (function(module) {
eval("require")("encoding"); module.exports = eval("require")("encoding");
/***/ }), /***/ }),
@@ -7139,6 +7139,13 @@ exports.setFailed = setFailed;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Logging Commands // Logging Commands
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/**
* Gets whether Actions Step Debug is on or not
*/
function isDebug() {
return process.env['RUNNER_DEBUG'] === '1';
}
exports.isDebug = isDebug;
/** /**
* Writes debug message to user log * Writes debug message to user log
* @param message debug message * @param message debug message
@@ -9178,7 +9185,7 @@ async function main() {
const github = new lib_github.GitHub(token, opts); const github = new lib_github.GitHub(token, opts);
const script = Object(core.getInput)('script', { required: true }); const script = Object(core.getInput)('script', { required: true });
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors. // Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context }, script); const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);
let encoding = Object(core.getInput)('result-encoding'); let encoding = Object(core.getInput)('result-encoding');
encoding = encoding ? encoding : 'json'; encoding = encoding ? encoding : 'json';
let output; let output;
+209 -111
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -1,19 +1,19 @@
{ {
"name": "github-script", "name": "github-script",
"description": "A GitHub action for executing a simple script", "description": "A GitHub action for executing a simple script",
"version": "0.6.0", "version": "0.9.0",
"author": "GitHub", "author": "GitHub",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.2", "@actions/core": "^1.2.3",
"@actions/github": "^2.1.1" "@actions/github": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.1.3", "@types/jest": "^25.1.4",
"@zeit/ncc": "^0.21.1", "@zeit/ncc": "^0.22.0",
"husky": "^4.2.3", "husky": "^4.2.3",
"jest": "^25.1.0", "jest": "^25.1.0",
"ts-jest": "^25.2.1", "ts-jest": "^25.2.1",
"typescript": "^3.8.2" "typescript": "^3.8.3"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
+1 -1
View File
@@ -19,7 +19,7 @@ async function main() {
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors. // Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
const result = await callAsyncFunction( const result = await callAsyncFunction(
{require: require, github, context}, {require: require, github, context, core},
script script
) )