Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d03ada4b0 | ||
|
|
293ee0ca2d | ||
|
|
67d29bab15 | ||
|
|
0baa1791ca | ||
|
|
b4fd05ccdf | ||
|
|
2ccd1edaf4 | ||
|
|
a59996ab35 | ||
|
|
7ca8635cd0 | ||
|
|
8117de6119 | ||
|
|
3f4f5a83e8 | ||
|
|
0e2c0d5c7c | ||
|
|
0d15461bee | ||
|
|
e4cc5a8d47 | ||
|
|
dc16f26602 | ||
|
|
8982156783 | ||
|
|
80a5e943b4 |
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Vendored
+10
-3
@@ -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;
|
||||||
|
|||||||
Generated
+209
-111
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -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
@@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user