Skip to content

πŸ™Œ OpenHands: AI-Driven Development

ci: pin external third-party actions to commit SHAs + scope Dependabot to composite actions (#14488)

Nelson Spence4c28c62c75f3
diff --git a/.github/actions/docker-image-tags/action.yml b/.github/actions/docker-image-tags/action.yml
index e54a4d04e8..4ac544f375 100644
--- a/.github/actions/docker-image-tags/action.yml
+++ b/.github/actions/docker-image-tags/action.yml
@@ -33,7 +33,7 @@ runs:
steps:
- name: Compute tags
id: meta
- uses: docker/metadata-action@v6
+ uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
env:
# Use the PR head SHA (not the merge SHA) for sha-prefixed tags.
DOCKER_METADATA_PR_HEAD_SHA: "true"
diff --git a/.github/actions/docker-merge-manifest/action.yml b/.github/actions/docker-merge-manifest/action.yml
index 4c1d89183d..73ed3c3608 100644
--- a/.github/actions/docker-merge-manifest/action.yml
+++ b/.github/actions/docker-merge-manifest/action.yml
@@ -13,14 +13,14 @@ runs:
using: composite
steps:
- name: Login to GHCR
- uses: docker/login-action@v4
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
+ uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Create multi-arch manifests
shell: bash
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 670fc1167d..83c69a3bdd 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -75,7 +75,10 @@ updates:
- "*"
- package-ecosystem: "github-actions"
- directory: "/"
+ directories:
+ - "/"
+ - "/.github/actions/docker-image-tags"
+ - "/.github/actions/docker-merge-manifest"
schedule:
interval: "weekly"
cooldown:
diff --git a/.github/workflows/_build-image.yml b/.github/workflows/_build-image.yml
index 8caa3c0d03..80de5dce1c 100644
--- a/.github/workflows/_build-image.yml
+++ b/.github/workflows/_build-image.yml
@@ -59,13 +59,13 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Login to GHCR
- uses: docker/login-action@v4
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v4
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
with:
driver-opts: ${{ inputs.buildx-driver-opts }}
- name: Compute per-arch tags
@@ -76,7 +76,7 @@ jobs:
ref-name: ${{ env.RELEVANT_REF_NAME }}
suffix: -${{ matrix.arch }}
- name: Build and push
- uses: docker/build-push-action@v7
+ uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
diff --git a/.github/workflows/enterprise-check-migrations.yml b/.github/workflows/enterprise-check-migrations.yml
index 89ec7afee7..739f04702f 100644
--- a/.github/workflows/enterprise-check-migrations.yml
+++ b/.github/workflows/enterprise-check-migrations.yml
@@ -39,7 +39,7 @@ jobs:
fi
- name: Find Comment
- uses: peter-evans/find-comment@v4
+ uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
@@ -48,7 +48,7 @@ jobs:
⚠️ This PR contains **migrations**
- name: Comment warning on PR
- uses: peter-evans/create-or-update-comment@v5
+ uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
diff --git a/.github/workflows/npm-publish-ui.yml b/.github/workflows/npm-publish-ui.yml
index c8f8a4be56..0ea8cdce75 100644
--- a/.github/workflows/npm-publish-ui.yml
+++ b/.github/workflows/npm-publish-ui.yml
@@ -66,7 +66,7 @@ jobs:
uses: actions/checkout@v6
- name: Setup Bun
- uses: oven-sh/setup-bun@v2
+ uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version-file: "openhands-ui/.bun-version"
diff --git a/.github/workflows/pr-review-evaluation.yml b/.github/workflows/pr-review-evaluation.yml
index f468e30d35..3239596c13 100644
--- a/.github/workflows/pr-review-evaluation.yml
+++ b/.github/workflows/pr-review-evaluation.yml
@@ -28,7 +28,7 @@ jobs:
steps:
- name: Download review trace artifact
id: download-trace
- uses: dawidd6/action-download-artifact@v21
+ uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
continue-on-error: true
with:
workflow: pr-review-by-openhands.yml
diff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.yml
index 9885b4f18d..a4e01c5788 100644
--- a/.github/workflows/py-tests.yml
+++ b/.github/workflows/py-tests.yml
@@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
id: buildx
- uses: docker/setup-buildx-action@v4
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Setup Node.js
@@ -119,7 +119,7 @@ jobs:
- name: Coverage comment
id: coverage_comment
- uses: py-cov-action/python-coverage-comment-action@v3
+ uses: py-cov-action/python-coverage-comment-action@53ff7553078bad69030786e486677315346c2dd2 # v3
with:
GITHUB_TOKEN: ${{ github.token }}
MERGE_COVERAGE_FILES: true
diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml
index 2b5525d01d..208c874b87 100644
--- a/.github/workflows/pypi-release.yml
+++ b/.github/workflows/pypi-release.yml
@@ -28,7 +28,7 @@ jobs:
with:
python-version: 3.12
- name: Install Poetry
- uses: snok/[email protected]
+ uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
virtualenvs-in-project: true
virtualenvs-path: ~/.virtualenvs
diff --git a/.github/workflows/tag-image.yml b/.github/workflows/tag-image.yml
index ac744cdc55..2763419615 100644
--- a/.github/workflows/tag-image.yml
+++ b/.github/workflows/tag-image.yml
@@ -22,16 +22,16 @@ jobs:
- ghcr.io/openhands/enterprise-server
steps:
- name: Login to GHCR
- uses: docker/login-action@v4
+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v4
+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Compute tags
id: meta
- uses: docker/metadata-action@v6
+ uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
with:
images: ${{ matrix.image }}
flavor: latest=auto
diff --git a/.github/workflows/ui-build.yml b/.github/workflows/ui-build.yml
index 12b857d69d..a16c7a9e83 100644
--- a/.github/workflows/ui-build.yml
+++ b/.github/workflows/ui-build.yml
@@ -23,7 +23,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- - uses: oven-sh/setup-bun@v2
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version-file: "openhands-ui/.bun-version"
- name: Install dependencies
diff --git a/AGENTS.md b/AGENTS.md
index 40902a5945..6d47a8c23e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -44,6 +44,12 @@ then re-run the command to ensure it passes. Common issues include:
- Be especially careful with `git reset --hard` after staging files, as it will remove accidentally staged files
- When remote has new changes, use `git fetch upstream && git rebase upstream/<branch>` on the same branch
+## GitHub Actions
+
+- Pin external third-party actions to a full 40-character commit SHA, with the version tag in a trailing comment (e.g. `uses: owner/repo@<sha> # v1.2.3`). Do not use mutable tags (`@v1`) or branches for third-party actions.
+- GitHub-authored (`actions/*`, `github/*`) and first-party (`OpenHands/*`) actions are currently exempt.
+- Dependabot's `github-actions` ecosystem bumps the pinned SHA and the trailing comment under the configured cooldown, so pinning does not block security or version updates.
+
## Lockfile Regeneration (Preserve Original Tool Versions)
When regenerating lockfiles (poetry.lock, uv.lock, etc.), you MUST use the same tool version that originally generated the lockfile to avoid unnecessary diff noise. Each lockfile contains a version header indicating which tool version was used.