-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (57 loc) · 2.43 KB
/
Copy pathupdate-opencode-plugin.yml
File metadata and controls
68 lines (57 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Update @opencode/plugin
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: update-opencode-plugin
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-24.04
steps:
- name: Checkout main
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
persist-credentials: false
- name: Record main commit
id: main
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2
- name: Check npm for the latest version
id: latest
run: bun scripts/update-opencode-plugin.ts
- name: Install dependencies and update lockfile
if: steps.latest.outputs.changed == 'true'
run: bun install
- name: Add plugin Changesets
if: steps.latest.outputs.changed == 'true'
env:
VERSION: ${{ steps.latest.outputs.version }}
run: |
bun run changeset-add -- usage-limits patch "Update @opencode/plugin to $VERSION"
bun run changeset-add -- force-input patch "Update @opencode/plugin to $VERSION"
- name: Create verified update commit
if: steps.latest.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
MAIN_SHA: ${{ steps.main.outputs.sha }}
VERSION: ${{ steps.latest.outputs.version }}
run: bun scripts/create-signed-github-commit.ts
- name: Open or update pull request
if: steps.latest.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.latest.outputs.version }}
run: |
pr_number=$(gh pr list --head update-opencode-plugin --base main --json number --jq 'if length > 0 then .[0].number else empty end')
if [ -n "$pr_number" ]; then
gh pr edit "$pr_number" --title "chore(deps): update @opencode/plugin" --body "Updates the shared @opencode/plugin dependency to $VERSION and includes patch Changesets for usage-limits and force-input."
else
gh pr create --base main --head update-opencode-plugin --title "chore(deps): update @opencode/plugin" --body "Updates the shared @opencode/plugin dependency to $VERSION and includes patch Changesets for usage-limits and force-input."
fi