Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
6d3beb123a Bump brace-expansion from 1.1.11 to 1.1.12
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 12:03:29 +00:00
5 changed files with 27 additions and 71 deletions

View File

@@ -167,7 +167,7 @@ jobs:
exit 1 exit 1
fi fi
echo "- Validating user-agent set to an empty string" echo "- Validating user-agent set to an empty string"
expected="actions/github-script octokit-core.js/" expected="octokit-core.js/"
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}" echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}"
exit 1 exit 1

View File

@@ -53,14 +53,6 @@ documentation.
## Breaking Changes ## 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 ### 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 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`: To pass inputs, set `env` vars on the action step and reference them in your script with `process.env`:
```yaml ```yaml
- uses: actions/github-script@v8 - uses: actions/github-script@v7
env: env:
TITLE: ${{ github.event.pull_request.title }} TITLE: ${{ github.event.pull_request.title }}
with: with:
@@ -118,7 +110,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@v8 - uses: actions/github-script@v7
id: set-result id: set-result
with: with:
script: return "Hello!" script: return "Hello!"
@@ -137,7 +129,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@v8 - uses: actions/github-script@v7
id: my-script id: my-script
with: with:
result-encoding: string 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: By default, requests made with the `github` instance will not be retried. You can configure this with the `retries` option:
```yaml ```yaml
- uses: actions/github-script@v8 - uses: actions/github-script@v7
id: my-script id: my-script
with: with:
result-encoding: string 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: You can also configure which status codes should be exempt from retries via the `retry-exempt-status-codes` option:
```yaml ```yaml
- uses: actions/github-script@v8 - uses: actions/github-script@v7
id: my-script id: my-script
with: with:
result-encoding: string result-encoding: string
@@ -196,7 +188,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@v8 uses: actions/github-script@v7
with: with:
script: console.log(context) script: console.log(context)
``` ```
@@ -212,7 +204,7 @@ jobs:
comment: comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
@@ -234,7 +226,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
github.rest.issues.addLabels({ github.rest.issues.addLabels({
@@ -256,7 +248,7 @@ jobs:
welcome: welcome:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
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
@@ -301,7 +293,7 @@ jobs:
diff: diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const diff_url = context.payload.pull_request.diff_url const diff_url = context.payload.pull_request.diff_url
@@ -325,7 +317,7 @@ jobs:
list-issues: list-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const query = `query($owner:String!, $name:String!, $label:String!) { const query = `query($owner:String!, $name:String!, $label:String!) {
@@ -359,7 +351,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const script = require('./path/to/script.js') const script = require('./path/to/script.js')
@@ -397,7 +389,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/github-script@v8 - uses: actions/github-script@v7
env: env:
SHA: '${{env.parentSHA}}' SHA: '${{env.parentSHA}}'
with: with:
@@ -441,7 +433,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@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const execa = require('execa') const execa = require('execa')
@@ -471,7 +463,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const { default: printStuff } = await import('${{ github.workspace }}/src/print-stuff.js') const { default: printStuff } = await import('${{ github.workspace }}/src/print-stuff.js')
@@ -515,7 +507,7 @@ jobs:
apply-label: apply-label:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
github-token: ${{ secrets.MY_PAT }} github-token: ${{ secrets.MY_PAT }}
script: | script: |
@@ -539,7 +531,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const exitCode = await exec.exec('echo', ['hello']) const exitCode = await exec.exec('echo', ['hello'])
@@ -557,7 +549,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/github-script@v8 - uses: actions/github-script@v7
with: with:
script: | script: |
const { const {

18
dist/index.js vendored
View File

@@ -36267,11 +36267,9 @@ async function main() {
const retries = parseInt(core.getInput('retries')); const retries = parseInt(core.getInput('retries'));
const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes')); const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes'));
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults); const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
const baseUserAgent = userAgent || 'actions/github-script';
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
const opts = { const opts = {
log: debug ? console : undefined, log: debug ? console : undefined,
userAgent: finalUserAgent, userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined, previews: previews ? previews.split(',') : undefined,
retry: retryOpts, retry: retryOpts,
request: requestOpts request: requestOpts
@@ -36315,20 +36313,6 @@ function handleError(err) {
console.error(err); console.error(err);
core.setFailed(`Unhandled error: ${err}`); core.setFailed(`Unhandled error: ${err}`);
} }
/**
* Gets the user agent string with orchestration ID appended if available
* @param userAgent The base user agent string
* @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set
*/
function getUserAgentWithOrchestrationId(userAgent) {
const orchestrationId = process.env['ACTIONS_ORCHESTRATION_ID'];
if (!orchestrationId) {
return userAgent;
}
// Sanitize orchestration ID - replace invalid characters with underscore
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_');
return `${userAgent} actions_orchestration_id/${sanitized}`;
}
})(); })();

12
package-lock.json generated
View File

@@ -2273,9 +2273,9 @@
} }
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "1.1.11", "version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"dependencies": { "dependencies": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -9067,9 +9067,9 @@
} }
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"

View File

@@ -39,12 +39,9 @@ async function main(): Promise<void> {
defaultGitHubOptions defaultGitHubOptions
) )
const baseUserAgent = userAgent || 'actions/github-script'
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent)
const opts: Options = { const opts: Options = {
log: debug ? console : undefined, log: debug ? console : undefined,
userAgent: finalUserAgent, userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined, previews: previews ? previews.split(',') : undefined,
retry: retryOpts, retry: retryOpts,
request: requestOpts request: requestOpts
@@ -99,20 +96,3 @@ function handleError(err: any): void {
console.error(err) console.error(err)
core.setFailed(`Unhandled error: ${err}`) core.setFailed(`Unhandled error: ${err}`)
} }
/**
* Gets the user agent string with orchestration ID appended if available
* @param userAgent The base user agent string
* @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set
*/
function getUserAgentWithOrchestrationId(userAgent: string): string {
const orchestrationId = process.env['ACTIONS_ORCHESTRATION_ID']
if (!orchestrationId) {
return userAgent
}
// Sanitize orchestration ID - replace invalid characters with underscore
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_')
return `${userAgent} actions_orchestration_id/${sanitized}`
}