Skip to content
Open
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
50 changes: 50 additions & 0 deletions .github/workflows/update-bee-js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update bee-js

on:
repository_dispatch:
types: [bee-js-released]

jobs:
update-bee-js:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate version
env:
VERSION: ${{ github.event.client_payload.version }}
run: |
if ! printf '%s' "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.-]+)?$'; then
echo "invalid version: $VERSION" >&2; exit 1
fi

- name: Update BEE_JS_VERSION in dependency.ts
env:
VERSION: ${{ github.event.client_payload.version }}
run: |
sed -i "s/BEE_JS_VERSION = '\\^[^']*'/BEE_JS_VERSION = '^\$VERSION'/" src/dependency.ts

- name: Generate App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.BEE_RUNNER_CLIENT_ID }}
private-key: ${{ secrets.BEE_RUNNER_KEY }}

- name: Create pull request
uses: peter-evans/create-pull-request@v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: 'chore: update bee-js to v${{ github.event.client_payload.version }}'
branch: update-bee-js-${{ github.event.client_payload.version }}
title: 'chore: update bee-js to v${{ github.event.client_payload.version }}'
body: |
Automated update of `@ethersphere/bee-js` to `^${{ github.event.client_payload.version }}`.

Please review the [bee-js changelog](https://github.com/ethersphere/bee-js/blob/master/CHANGELOG.md) before merging.
labels: dependencies
Loading