π 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.ymlindex 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 tagsid: meta- uses: docker/metadata-action@v6+ uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6env:# 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.ymlindex 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: compositesteps:- name: Login to GHCR- uses: docker/login-action@v4+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4with:registry: ghcr.iousername: ${{ 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 manifestsshell: bashdiff --git a/.github/dependabot.yml b/.github/dependabot.ymlindex 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.ymlindex 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 # v4with:registry: ghcr.iousername: ${{ github.repository_owner }}password: ${{ secrets.GITHUB_TOKEN }}- name: Set up Docker Buildx- uses: docker/setup-buildx-action@v4+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4with: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 # v7with:context: ${{ inputs.context }}file: ${{ inputs.dockerfile }}diff --git a/.github/workflows/enterprise-check-migrations.yml b/.github/workflows/enterprise-check-migrations.ymlindex 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 # v4id: find-commentwith: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 # v5with: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.ymlindex 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 # v2with:bun-version-file: "openhands-ui/.bun-version"diff --git a/.github/workflows/pr-review-evaluation.yml b/.github/workflows/pr-review-evaluation.ymlindex 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 artifactid: download-trace- uses: dawidd6/action-download-artifact@v21+ uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21continue-on-error: truewith:workflow: pr-review-by-openhands.ymldiff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.ymlindex 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 Buildxid: buildx- uses: docker/setup-buildx-action@v4+ uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4- name: Install tmuxrun: sudo apt-get update && sudo apt-get install -y tmux- name: Setup Node.js@@ -119,7 +119,7 @@ jobs:- name: Coverage commentid: coverage_comment- uses: py-cov-action/python-coverage-comment-action@v3+ uses: py-cov-action/python-coverage-comment-action@53ff7553078bad69030786e486677315346c2dd2 # v3with:GITHUB_TOKEN: ${{ github.token }}MERGE_COVERAGE_FILES: truediff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.ymlindex 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.1with:virtualenvs-in-project: truevirtualenvs-path: ~/.virtualenvsdiff --git a/.github/workflows/tag-image.yml b/.github/workflows/tag-image.ymlindex ac744cdc55..2763419615 100644--- a/.github/workflows/tag-image.yml+++ b/.github/workflows/tag-image.yml@@ -22,16 +22,16 @@ jobs:- ghcr.io/openhands/enterprise-serversteps:- name: Login to GHCR- uses: docker/login-action@v4+ uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4with:registry: ghcr.iousername: ${{ 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 tagsid: meta- uses: docker/metadata-action@v6+ uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6with:images: ${{ matrix.image }}flavor: latest=autodiff --git a/.github/workflows/ui-build.yml b/.github/workflows/ui-build.ymlindex 12b857d69d..a16c7a9e83 100644--- a/.github/workflows/ui-build.yml+++ b/.github/workflows/ui-build.yml@@ -23,7 +23,7 @@ jobs:steps:- name: Checkoutuses: actions/checkout@v6- - uses: oven-sh/setup-bun@v2+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2with:bun-version-file: "openhands-ui/.bun-version"- name: Install dependenciesdiff --git a/AGENTS.md b/AGENTS.mdindex 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.