Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Use OIDC for npm publish (#990)

Jakub Novák60fb009e4a8a
diff --git a/.github/workflows/publish_packages.yml b/.github/workflows/publish_packages.yml
index 153524935..1cfbe0b51 100644
--- a/.github/workflows/publish_packages.yml
+++ b/.github/workflows/publish_packages.yml
@@ -5,13 +5,12 @@ on:
secrets:
E2B_API_KEY:
required: true
- NPM_TOKEN:
- required: true
PYPI_TOKEN:
required: true
permissions:
contents: write
+ id-token: write
jobs:
test:
@@ -54,9 +53,10 @@ jobs:
version: '${{ env.TOOL_VERSION_PNPM }}'
- name: Setup Node.js
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
+ registry-url: 'https://registry.npmjs.org'
cache: pnpm
- name: Configure pnpm
@@ -64,6 +64,11 @@ jobs:
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
+ - name: Update npm
+ run: |
+ npm install -g npm@^11.6
+ npm --version
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -79,7 +84,7 @@ jobs:
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ NPM_TOKEN: "" # See https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Generate SDK reference
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 163f3aaca..fff4f1d76 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -6,6 +6,7 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
+ id-token: write
contents: write
jobs:
@@ -32,7 +33,7 @@ jobs:
version: '${{ env.TOOL_VERSION_PNPM }}'
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: 'https://registry.npmjs.org'
@@ -80,7 +81,7 @@ jobs:
version: '${{ env.TOOL_VERSION_PNPM }}'
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: 'https://registry.npmjs.org'