Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/assembler-preview-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Delete GitHub environment
uses: actions/github-script@v8
uses: actions/github-script@v9
id: delete-deployment
with:
script: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/assembler-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Get PR details
if: github.event_name == 'workflow_dispatch'
id: pr-details
uses: actions/github-script@v8
uses: actions/github-script@v9
env:
PR_NUMBER: ${{ inputs.pr_number }}
with:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
persist-credentials: false

- name: Create Deployment
uses: actions/github-script@v8
uses: actions/github-script@v9
id: deployment
env:
PR_SHA: ${{ steps.pr-details.outputs.result || github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:

- name: Update Deployment Status
if: always() && steps.deployment.outputs.result
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
await github.rest.repos.createDeploymentStatus({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-add-needs-triage-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add needs triage label
uses: actions/github-script@v8
uses: actions/github-script@v9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all github-script uses are pinned to full SHAs (40 hex chars).
rg -nP --type=yaml 'uses:\s*actions/github-script@(?![0-9a-f]{40}\b)'

Repository: elastic/docs-builder

Length of output: 46


🏁 Script executed:

# First, find and examine the specific workflow file
find . -name "auto-add-needs-triage-label.yml" -type f 2>/dev/null | head -5

Repository: elastic/docs-builder

Length of output: 115


🏁 Script executed:

# Search for all github-script uses in workflow files
rg -n "actions/github-script" --type=yaml

Repository: elastic/docs-builder

Length of output: 46


🏁 Script executed:

# Read the workflow file to check actual contents
cat -n ./.github/workflows/auto-add-needs-triage-label.yml

Repository: elastic/docs-builder

Length of output: 767


Pin actions/github-script to an immutable SHA instead of @v9.

Line 18 uses a floating tag, which risks version drift if the tag is moved. Pin to a full commit SHA (e.g., 3a2844b7e9c422d3c10d287c895573f7108da1b3) for CI stability and security.

Suggested change
-        uses: actions/github-script@v9
+        uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: actions/github-script@v9
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/auto-add-needs-triage-label.yml at line 18, Replace the
floating tag "actions/github-script@v9" with an immutable commit SHA to avoid
version drift; update the uses entry (the line containing
actions/github-script@v9) to use a full commit SHA (for example,
3a2844b7e9c422d3c10d287c895573f7108da1b3) so the workflow references an exact
revision.

with:
script: |
github.rest.issues.addLabels({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/comment-on-asciidoc-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Add a comment if .asciidoc files changed
if: steps.check-files.outputs.any_changed == 'true'
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/detect-duplicate-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Detect potential duplicate issues
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
const { owner, repo } = context.repo;
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
- name: Get modified file detail
if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name)
id: check-modified-file-detail
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
PATH_PATTERN: "${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }}"
IGNORE_PATTERNS: |
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
|| startsWith(github.event_name, 'pull_request')
)
uses: actions/github-script@v8
uses: actions/github-script@v9
id: deployment
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -469,7 +469,7 @@ jobs:
uses: elastic/docs-builder/actions/update-link-index@main

- name: Update deployment status
uses: actions/github-script@v8
uses: actions/github-script@v9
# disabled: deployments are not enabled on this branch
if: >
false
Expand Down Expand Up @@ -509,7 +509,7 @@ jobs:
steps:
- name: Comment on PR
continue-on-error: true
uses: actions/github-script@v8
uses: actions/github-script@v9
env:
ALL_CHANGED_FILES: ${{ needs.check.outputs.all_changed_files }}
PATH_PREFIX: ${{ needs.build.outputs.path_prefix }}
Expand Down Expand Up @@ -584,7 +584,7 @@ jobs:
}
- name: Comment on docs changes about versioning requirements
if: inputs.enable-cumulative-comment == true
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# language=javascript
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Delete GitHub environment
uses: actions/github-script@v8
uses: actions/github-script@v9
id: delete-deployment
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
commitish: ${{ github.sha }}
- name: Create tag
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
script: |
github.rest.git.createRef({
Expand Down
Loading