Skip to content

Commit

Permalink
Merge pull request #239 from actions/joshmgross/v6
Browse files Browse the repository at this point in the history
Release version 6.0.0
  • Loading branch information
joshmgross authored Feb 11, 2022
2 parents 6b8d8aa + cd8eebf commit 53cdbb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

Expand All @@ -50,7 +58,7 @@ The return value of the script will be in the step's outputs under the
"result" key.

```yaml
- uses: actions/github-script@v5
- uses: actions/github-script@v6
id: set-result
with:
script: return "Hello!"
Expand All @@ -69,7 +77,7 @@ output of a github-script step. For some workflows, string encoding is preferred
`result-encoding` input:

```yaml
- uses: actions/github-script@v5
- uses: actions/github-script@v6
id: my-script
with:
result-encoding: string
Expand All @@ -87,7 +95,7 @@ By default, github-script will use the token provided to your workflow.

```yaml
- name: View context attributes
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: console.log(context)
```
Expand All @@ -103,7 +111,7 @@ jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
Expand All @@ -125,7 +133,7 @@ jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
Expand All @@ -145,7 +153,7 @@ jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
// Get a list of all issues created by the PR opener
Expand Down Expand Up @@ -188,7 +196,7 @@ jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
const diff_url = context.payload.pull_request.diff_url
Expand All @@ -212,7 +220,7 @@ jobs:
list-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
const query = `query($owner:String!, $name:String!, $label:String!) {
Expand Down Expand Up @@ -246,7 +254,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
const script = require('./path/to/script.js')
Expand Down Expand Up @@ -284,7 +292,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v5
- uses: actions/github-script@v6
env:
SHA: '${{env.parentSHA}}'
with:
Expand Down Expand Up @@ -328,7 +336,7 @@ jobs:
- run: npm ci
# or one-off:
- run: npm install execa
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
script: |
const execa = require('execa')
Expand All @@ -349,7 +357,7 @@ jobs:
echo-input:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
env:
FIRST_NAME: Mona
LAST_NAME: Octocat
Expand Down Expand Up @@ -377,7 +385,7 @@ jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.MY_PAT }}
script: |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "github-script",
"description": "A GitHub action for executing a simple script",
"version": "5.1.0",
"version": "6.0.0",
"author": "GitHub",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -54,4 +54,4 @@
"ts-jest": "^27.0.5",
"typescript": "^4.3.5"
}
}
}

0 comments on commit 53cdbb4

Please sign in to comment.