Merge pull request #239 from actions/joshmgross/v6

Release version 6.0.0
This commit is contained in:
Josh Gross
2022-02-11 10:21:20 -05:00
committed by GitHub
2 changed files with 24 additions and 16 deletions

View File

@@ -32,7 +32,15 @@ defined, so you don't have to import them (see examples below).
See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client See [octokit/rest.js](https://octokit.github.io/rest.js/) for the API client
documentation. documentation.
## Breaking changes in V5 ## Breaking Changes
### Breaking changes in V6
Version 6 of this action updated the runtime to Node 16 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-using-nodejs-v16
All scripts are now run with Node 16 instead of Node 12 and are affected by any breaking changes between Node 12 and 16.
### Breaking changes in V5
Version 5 of this action includes the version 5 of `@actions/github` and `@octokit/plugin-rest-endpoint-methods`. As part of this update, the Octokit context available via `github` no longer has REST methods directly. These methods are available via `github.rest.*` - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0 Version 5 of this action includes the version 5 of `@actions/github` and `@octokit/plugin-rest-endpoint-methods`. As part of this update, the Octokit context available via `github` no longer has REST methods directly. These methods are available via `github.rest.*` - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0
@@ -50,7 +58,7 @@ The return value of the script will be in the step's outputs under the
"result" key. "result" key.
```yaml ```yaml
- uses: actions/github-script@v5 - uses: actions/github-script@v6
id: set-result id: set-result
with: with:
script: return "Hello!" script: return "Hello!"
@@ -69,7 +77,7 @@ output of a github-script step. For some workflows, string encoding is preferred
`result-encoding` input: `result-encoding` input:
```yaml ```yaml
- uses: actions/github-script@v5 - uses: actions/github-script@v6
id: my-script id: my-script
with: with:
result-encoding: string result-encoding: string
@@ -87,7 +95,7 @@ By default, github-script will use the token provided to your workflow.
```yaml ```yaml
- name: View context attributes - name: View context attributes
uses: actions/github-script@v5 uses: actions/github-script@v6
with: with:
script: console.log(context) script: console.log(context)
``` ```
@@ -103,7 +111,7 @@ jobs:
comment: comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
@@ -125,7 +133,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.addLabels({ github.rest.issues.addLabels({
@@ -145,7 +153,7 @@ jobs:
welcome: welcome:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
// Get a list of all issues created by the PR opener // Get a list of all issues created by the PR opener
@@ -188,7 +196,7 @@ jobs:
diff: diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const diff_url = context.payload.pull_request.diff_url const diff_url = context.payload.pull_request.diff_url
@@ -212,7 +220,7 @@ jobs:
list-issues: list-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const query = `query($owner:String!, $name:String!, $label:String!) { const query = `query($owner:String!, $name:String!, $label:String!) {
@@ -246,7 +254,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const script = require('./path/to/script.js') const script = require('./path/to/script.js')
@@ -284,7 +292,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/github-script@v5 - uses: actions/github-script@v6
env: env:
SHA: '${{env.parentSHA}}' SHA: '${{env.parentSHA}}'
with: with:
@@ -328,7 +336,7 @@ jobs:
- run: npm ci - run: npm ci
# or one-off: # or one-off:
- run: npm install execa - run: npm install execa
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
script: | script: |
const execa = require('execa') const execa = require('execa')
@@ -349,7 +357,7 @@ jobs:
echo-input: echo-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
env: env:
FIRST_NAME: Mona FIRST_NAME: Mona
LAST_NAME: Octocat LAST_NAME: Octocat
@@ -377,7 +385,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
github-token: ${{ secrets.MY_PAT }} github-token: ${{ secrets.MY_PAT }}
script: | script: |

View File

@@ -1,7 +1,7 @@
{ {
"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": "5.1.0", "version": "6.0.0",
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "dist/index.js",
@@ -54,4 +54,4 @@
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"typescript": "^4.3.5" "typescript": "^4.3.5"
} }
} }