mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Compare commits
1 Commits
dependabot
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d3beb123a |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v4
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -69,4 +69,4 @@ jobs:
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
||||
44
README.md
44
README.md
@@ -53,14 +53,6 @@ documentation.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
### V8
|
||||
|
||||
Version 8 of this action updated the runtime to Node 24 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions
|
||||
|
||||
All scripts are now run with Node 24 instead of Node 20 and are affected by any breaking changes between Node 20 and 24.
|
||||
|
||||
**This requires a minimum Actions Runner version of [v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1)**
|
||||
|
||||
### V7
|
||||
|
||||
Version 7 of this action updated the runtime to Node 20 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions
|
||||
@@ -99,7 +91,7 @@ and potential `SyntaxError`s when the expression is not valid JavaScript code (p
|
||||
To pass inputs, set `env` vars on the action step and reference them in your script with `process.env`:
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
env:
|
||||
TITLE: ${{ github.event.pull_request.title }}
|
||||
with:
|
||||
@@ -118,7 +110,7 @@ The return value of the script will be in the step's outputs under the
|
||||
"result" key.
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
id: set-result
|
||||
with:
|
||||
script: return "Hello!"
|
||||
@@ -137,7 +129,7 @@ output of a github-script step. For some workflows, string encoding is preferred
|
||||
`result-encoding` input:
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
id: my-script
|
||||
with:
|
||||
result-encoding: string
|
||||
@@ -149,7 +141,7 @@ output of a github-script step. For some workflows, string encoding is preferred
|
||||
By default, requests made with the `github` instance will not be retried. You can configure this with the `retries` option:
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
id: my-script
|
||||
with:
|
||||
result-encoding: string
|
||||
@@ -167,7 +159,7 @@ In this example, request failures from `github.rest.issues.get()` will be retrie
|
||||
You can also configure which status codes should be exempt from retries via the `retry-exempt-status-codes` option:
|
||||
|
||||
```yaml
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
id: my-script
|
||||
with:
|
||||
result-encoding: string
|
||||
@@ -196,7 +188,7 @@ By default, github-script will use the token provided to your workflow.
|
||||
|
||||
```yaml
|
||||
- name: View context attributes
|
||||
uses: actions/github-script@v8
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: console.log(context)
|
||||
```
|
||||
@@ -212,7 +204,7 @@ jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
@@ -234,7 +226,7 @@ jobs:
|
||||
apply-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
@@ -256,7 +248,7 @@ jobs:
|
||||
welcome:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
// Get a list of all issues created by the PR opener
|
||||
@@ -301,7 +293,7 @@ jobs:
|
||||
diff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const diff_url = context.payload.pull_request.diff_url
|
||||
@@ -325,7 +317,7 @@ jobs:
|
||||
list-issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const query = `query($owner:String!, $name:String!, $label:String!) {
|
||||
@@ -359,7 +351,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const script = require('./path/to/script.js')
|
||||
@@ -397,7 +389,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
env:
|
||||
SHA: '${{env.parentSHA}}'
|
||||
with:
|
||||
@@ -441,7 +433,7 @@ jobs:
|
||||
- run: npm ci
|
||||
# or one-off:
|
||||
- run: npm install execa
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const execa = require('execa')
|
||||
@@ -471,7 +463,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { default: printStuff } = await import('${{ github.workspace }}/src/print-stuff.js')
|
||||
@@ -515,7 +507,7 @@ jobs:
|
||||
apply-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.MY_PAT }}
|
||||
script: |
|
||||
@@ -539,7 +531,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const exitCode = await exec.exec('echo', ['hello'])
|
||||
@@ -557,7 +549,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/github-script@v8
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const {
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -2273,9 +2273,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -9067,9 +9067,9 @@
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
||||
Reference in New Issue
Block a user