Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d03ada4b0 | ||
|
|
293ee0ca2d | ||
|
|
67d29bab15 | ||
|
|
0baa1791ca | ||
|
|
b4fd05ccdf | ||
|
|
2ccd1edaf4 | ||
|
|
a59996ab35 | ||
|
|
7ca8635cd0 | ||
|
|
8117de6119 | ||
|
|
3f4f5a83e8 | ||
|
|
0e2c0d5c7c | ||
|
|
0d15461bee | ||
|
|
e4cc5a8d47 | ||
|
|
dc16f26602 | ||
|
|
8982156783 |
@@ -8,9 +8,10 @@ jobs:
|
||||
- id: output-set
|
||||
uses: actions/github-script@master
|
||||
with:
|
||||
script: return 'test'
|
||||
script: return core.getInput('input-value')
|
||||
result-encoding: string
|
||||
input-value: output
|
||||
- run: |
|
||||
if [[ "${{steps.output-set.outputs.result}}" != "test" ]]; then
|
||||
if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,7 @@ be provided:
|
||||
[octokit/rest.js](https://github.com/octokit/rest.js) client
|
||||
- `context` An object containing the [context of the workflow
|
||||
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
|
||||
defined, so you don't have to (see examples below).
|
||||
@@ -42,7 +43,7 @@ jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@0.8.0
|
||||
- uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -64,7 +65,7 @@ jobs:
|
||||
apply-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@0.8.0
|
||||
- uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -85,7 +86,7 @@ jobs:
|
||||
welcome:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@0.8.0
|
||||
- uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -129,7 +130,7 @@ jobs:
|
||||
diff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@0.8.0
|
||||
- uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -148,7 +149,7 @@ output of a github-script step. For some workflows, string encoding is preferred
|
||||
`result-encoding` input:
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@0.8.0
|
||||
- uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
result-encoding: string
|
||||
|
||||
Vendored
+10
-3
@@ -298,9 +298,9 @@ module.exports = require("tls");
|
||||
/***/ }),
|
||||
|
||||
/***/ 18:
|
||||
/***/ (function() {
|
||||
/***/ (function(module) {
|
||||
|
||||
eval("require")("encoding");
|
||||
module.exports = eval("require")("encoding");
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -7139,6 +7139,13 @@ exports.setFailed = setFailed;
|
||||
//-----------------------------------------------------------------------
|
||||
// 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
|
||||
* @param message debug message
|
||||
@@ -9178,7 +9185,7 @@ async function main() {
|
||||
const github = new lib_github.GitHub(token, opts);
|
||||
const script = Object(core.getInput)('script', { required: true });
|
||||
// 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');
|
||||
encoding = encoding ? encoding : 'json';
|
||||
let output;
|
||||
|
||||
Generated
+209
-111
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"name": "github-script",
|
||||
"description": "A GitHub action for executing a simple script",
|
||||
"version": "0.8.0",
|
||||
"version": "0.9.0",
|
||||
"author": "GitHub",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.2",
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/github": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.1.3",
|
||||
"@zeit/ncc": "^0.21.1",
|
||||
"@types/jest": "^25.1.4",
|
||||
"@zeit/ncc": "^0.22.0",
|
||||
"husky": "^4.2.3",
|
||||
"jest": "^25.1.0",
|
||||
"ts-jest": "^25.2.1",
|
||||
"typescript": "^3.8.2"
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ async function main() {
|
||||
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
|
||||
const result = await callAsyncFunction(
|
||||
{require: require, github, context},
|
||||
{require: require, github, context, core},
|
||||
script
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user