Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

chore(ci): remove the Dependabot changeset workflow (#1683)

Mish Ushakove130ba7f3bf7
diff --git a/.changeset/README.md b/.changeset/README.md
index bbe24c6e0..fa18076f5 100644
--- a/.changeset/README.md
+++ b/.changeset/README.md
@@ -7,9 +7,3 @@ npx changeset
```
in the root of the project. This will create a new changeset in the `.changeset` folder.
-
-Dependabot pull requests get one automatically: `.github/workflows/dependabot_changeset.yml`
-commits a `patch` changeset for every released package whose direct production dependencies the
-bump touches. Dev-only and transitive-only bumps are left alone, and the workflow never overwrites
-a changeset that is already on the branch — so edit or replace the generated file whenever the bump
-deserves a better description or a larger version step.
diff --git a/.github/workflows/dependabot_changeset.yml b/.github/workflows/dependabot_changeset.yml
deleted file mode 100644
index 2d9dd3a22..000000000
--- a/.github/workflows/dependabot_changeset.yml
+++ /dev/null
@@ -1,132 +0,0 @@
-name: Dependabot Changeset
-
-on:
- pull_request_target:
- types: [opened, reopened, synchronize]
-
-permissions: {}
-
-# One writer per pull request: Dependabot force-pushes when it rebases, and two
-# runs racing on the same PR would both commit a changeset.
-concurrency:
- group: dependabot-changeset-${{ github.event.pull_request.number }}
- cancel-in-progress: true
-
-jobs:
- changes:
- name: Detect changes
- # `pull_request_target` runs this file from the base branch, which is the
- # only way to reach Actions secrets from a Dependabot pull request: events
- # raised by Dependabot see a read-only `GITHUB_TOKEN` and the separate
- # Dependabot secret store.
- if: >-
- github.event.pull_request.user.login == 'dependabot[bot]' &&
- github.event.pull_request.head.repo.full_name == github.repository
- runs-on: ubuntu-latest
- permissions:
- pull-requests: read # required by dependabot/fetch-metadata and dorny/paths-filter
- outputs:
- # `dependency-type` is the highest-precedence type in the pull request
- # (`direct:production` > `direct:development` > `indirect`). Only a direct
- # production dependency reaches users of a published package; dev tooling
- # and transitive-only lockfile bumps need no release. That type covers the
- # whole pull request while the filters are per directory, so a group that
- # mixes a production bump in one package with a dev-only bump in another
- # names both — drop the extra line from the committed file if it matters.
- # A changeset already on the branch is left alone: a maintainer may have
- # written a better one by hand, and this workflow reruns on its own commit.
- changeset: >-
- ${{ steps.metadata.outputs.dependency-type == 'direct:production'
- && steps.filter.outputs.changeset != 'true'
- && (steps.filter.outputs.js-sdk == 'true'
- || steps.filter.outputs.python-sdk == 'true'
- || steps.filter.outputs.cli == 'true') }}
- packages: >-
- ${{ steps.filter.outputs.js-sdk == 'true' && 'e2b' || '' }}
- ${{ steps.filter.outputs.python-sdk == 'true' && '@e2b/python-sdk' || '' }}
- ${{ steps.filter.outputs.cli == 'true' && '@e2b/cli' || '' }}
- # Dependabot reports one `new-version` per bump but none for a group of
- # them, and joins grouped names with a comma.
- summary: >-
- ${{ contains(steps.metadata.outputs.dependency-names, ',')
- && format('Update dependencies: {0}.', steps.metadata.outputs.dependency-names)
- || format('Update the `{0}` dependency to {1}.',
- steps.metadata.outputs.dependency-names, steps.metadata.outputs.new-version) }}
- steps:
- - name: Filter changed paths
- # Reached by a `pull_request_target` trigger, so this action sees a
- # privileged token — scrutinise any bump here more closely than most.
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3.0.4
- id: filter
- with:
- # Dependabot edits the manifest of every workspace package it updates,
- # so the changed paths are the mapping from bump to released package.
- filters: |
- js-sdk:
- - 'packages/js-sdk/**'
- python-sdk:
- - 'packages/python-sdk/**'
- cli:
- - 'packages/cli/**'
- changeset:
- - '.changeset/!(README).md'
-
- - name: Fetch Dependabot metadata
- id: metadata
- # Not needed once a changeset is on the branch, and skipping keeps this
- # step away from the pull request the workflow has committed to itself:
- # the action only reports metadata for a pull request whose commits are
- # all Dependabot's.
- if: steps.filter.outputs.changeset != 'true'
- uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
-
- changeset:
- name: Add changeset
- needs: changes
- if: needs.changes.outputs.changeset == 'true'
- runs-on: ubuntu-latest
-
- steps:
- # The default token cannot be used for the push: `GITHUB_TOKEN` is
- # read-only on Dependabot events, and commits it authors do not start new
- # workflow runs, so the required checks would never report on the new head
- # commit and the pull request would be unmergeable.
- - name: Generate token to push to the pull request branch
- id: app-token
- uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2
- with:
- app-id: ${{ vars.VERSION_BUMPER_APPID }}
- private-key: ${{ secrets.VERSION_BUMPER_SECRET }}
- permission-contents: write
-
- - name: Checkout the pull request branch
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- with:
- ref: ${{ github.event.pull_request.head.ref }}
- token: ${{ steps.app-token.outputs.token }}
-
- # Always `patch`: bumping a dependency is not itself a change to our own
- # API, whatever the dependency's semver step was. Edit the committed file
- # if a bump deserves more than that.
- - name: Commit the changeset
- env:
- PR: ${{ github.event.pull_request.number }}
- PACKAGES: ${{ needs.changes.outputs.packages }}
- SUMMARY: ${{ needs.changes.outputs.summary }}
- run: |
- file=".changeset/dependabot-$PR.md"
- {
- echo '---'
- for package in $PACKAGES; do echo "'$package': patch"; done
- echo '---'
- echo
- echo "$SUMMARY"
- } >"$file"
-
- git config user.name 'github-actions[bot]'
- git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- git add "$file"
- git commit -m "chore: add changeset for #$PR"
- git push