Skip to content

Commit d77458a

Browse files
pRizzopencodeRettendBrendonovichactions-user
authored
sync: catch-up batch 001 (first 200 upstream commits) (#2)
* release: v1.1.42 * feat(desktop): Add desktop deep link (anomalyco#10072) Co-authored-by: Brendan Allan <git@brendonovich.dev> * chore: generate * chore: update nix node_modules hashes * fix: remove redundant Highlights heading from publish template (anomalyco#11121) * ignore: update download stats 2026-01-29 * fix(telemetry): restore userId and sessionId metadata in experimental_telemetry (anomalyco#8195) * fix: ensure kimi k2.5 from fireworks ai and kimi for coding providers properly set temperature * ci: added gh workflow that adds 'contributor' label to PRs/Issues (anomalyco#11118) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> * tweak: add 'skill' to permissions config section so that ides will show it as autocomplete option (this is already a respected setting) * zen: m2.1 and glm4.7 free models * feat: support config skill registration (anomalyco#9640) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> * chore: regen sdk * chore: format code * chore: generate * ci (anomalyco#11149) Co-authored-by: opencode <opencode@sst.dev> * test: skip failing tests (anomalyco#11184) * chore: consolidate and standardize workflow files (anomalyco#11183) * ci: disable nix-desktop workflow (anomalyco#11188) * ci: remove push triggers from workflow files (anomalyco#11186) * feat: add beta branch sync workflow for contributor PRs (anomalyco#11190) * feat: expose acp thinking variants (anomalyco#9064) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> * fix(app): better header item wrapping (anomalyco#10831) * fix: show all provider models when no providers connected (anomalyco#11198) * zen: kimi k2.5 free (anomalyco#11199) * fix: use ?? to prevent args being undefined for mcp server in some cases (anomalyco#11203) * feat(config): add managed settings support for enterprise deployments (anomalyco#6441) Co-authored-by: Dax <mail@thdxr.com> * chore: update nix node_modules hashes * ci * ci * ci * ci * release: v1.1.43 * ci: upgrade bun cache to stickydisk for faster ci builds * ci * ci: trigger publish workflow automatically after beta builds complete * ci * test(app): test for toggling model variant (anomalyco#11221) * fix(app): version to latest to avoid errors for new devs (anomalyco#11201) * ci * ci * ci * fix(beta): use local git rebase instead of gh pr update-branch * fix(app): dialog not closing * fix(app): free model scroll * sync * fix(app): free model layout * ci: cache apt packages to reduce CI build times on ubuntu * ci: add container build workflow Add prebuilt build images and a publish workflow to speed CI by reusing heavy dependencies. * ci: fix container build script Invoke docker build with Bun shell so commands run correctly, and document default automation behavior. * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * release: v1.1.45 * fix: rm ai sdk middleware that was preventing <think> blocks from being sent back as assistant message content (anomalyco#11270) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * ci * ci * ci * ci * sync * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * wip: zen (anomalyco#11343) * chore: generate * ci: update pr template (anomalyco#11341) * ci * feat: Transitions, spacing, scroll fade, prompt area update (anomalyco#11168) Co-authored-by: Github Action <action@github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: aaroniker <4730431+aaroniker@users.noreply.github.com> * chore: generate * test(app): change language test (anomalyco#11295) * chore(tui): remove unused experimental keys (anomalyco#11195) * chore: generate * release: v1.1.46 * commit * fix(github): add owner parameter to app token for org-wide repo access * release: v1.1.47 * ci: increase ARM runner to 8 vCPUs for faster Tauri builds * fix(provider): exclude chat models from textVerbosity setting (anomalyco#11363) * refactor(app): refactored tests + added project tests (anomalyco#11349) * refactor(provider): remove google-vertex-anthropic special case in ge… (anomalyco#10743) * fix: handle redirected_statement treesitter node in bash permissions (anomalyco#6737) * test: add llm.test.ts (anomalyco#11375) * docs: update agents options section to include color and top_p options (anomalyco#11355) * fix: ensure ask question tool isn't included when using acp (anomalyco#11379) * chore(deps): bump ai-sdk packages (anomalyco#11383) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * fix(provider): use snake_case for thinking param with OpenAI-compatible APIs (anomalyco#10109) * chore: generate * feat: make skills invokable as slash commands in the TUI - Add Skill.content() method to load skill template content from SKILL.md files - Modify Command.list() to include skills as invokable commands - Add 'skill' boolean property to Command.Info schema - Update autocomplete to show skills with (Skill) label in slash commands - Regenerate SDK to include skill property in Command type * feat(build): respect OPENCODE_MODELS_URL env var (anomalyco#11384) * Revert "feat: make skills invokable as slash commands in the TUI" This reverts commit 8512655. * feat(opencode): add copilot specific provider to properly handle copilot reasoning tokens (anomalyco#8900) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com> * chore: generate * ci: schedule beta workflow hourly to automate sync runs * ci: allow manual beta workflow trigger so users can release on demand instead of waiting for hourly schedule * ci: remove workflow restrictions to allow all PR triggers for broader CI coverage * ci: remove pull-request write permissions from beta workflow * fix: ensure the mistral ordering fixes also apply to devstral (anomalyco#11412) * core: prevent parallel test runs from contaminating environment variables * ci: run tests automatically when code is pushed to dev branch * fix: don't --follow by default for grep and other things using ripgrep (anomalyco#11415) * feat: make skills invokable as slash commands in the TUI (anomalyco#11390) * chore: generate * core: ensure models configuration is not empty before loading * ci: copy models fixture for e2e test consistency * tui: allow specifying custom models file path via OPENCODE_MODELS_PATH Users can now configure their own models configuration file by setting the OPENCODE_MODELS_PATH environment variable, providing more flexibility for testing and configuration. * sync * chore: generate * test: fix flaky test (anomalyco#11427) * test(app): session actions (anomalyco#11386) * Revert "feat: Transitions, spacing, scroll fade, prompt area update (anomalyco#11168)" (anomalyco#11461) Co-authored-by: adamelmore <2363879+adamdottv@users.noreply.github.com> * release: v1.1.48 * fix(app): session header 'share' button to hug content (anomalyco#11371) * fix(pty): Add UTF-8 encoding defaults for Windows PTY (anomalyco#11459) * feat(app): add skill slash commands (anomalyco#11369) * Revert "feat(app): add skill slash commands" (anomalyco#11484) * feat(opencode): add reasoning variants support for SAP AI Core (anomalyco#8753) Co-authored-by: Github Action <action@github.com> * docs: fix documentation issues (anomalyco#11435) Co-authored-by: damaozi <1811866786@qq.com> * fix(nix): restore native runners for darwin hash computation (anomalyco#11495) * fix(provider): use process.env directly for runtime env mutations (anomalyco#11482) * tweak: show actual retry error message instead of generic error msg (anomalyco#11520) * tui: enable password authentication for remote session attachment Allow users to authenticate when attaching to a remote OpenCode session by supporting basic auth via a password flag or OPENCODE_SERVER_PASSWORD environment variable * test(app): general settings, shortcuts, providers and status popover (anomalyco#11517) * chore: generate * fix(ci): portable hash parsing in nix-hashes workflow (anomalyco#11533) * ci: fix nix hash issue (anomalyco#11530) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * chore: update nix node_modules hashes * fix(app): rendering question tool when the step are collapsed (anomalyco#11539) * feat: add skill dialog for selecting and inserting skills (anomalyco#11547) * fix: issue where you couldn't @ folders/files that started with a "." (anomalyco#11553) * ci: fixed stale pr workflow (anomalyco#11310) * fix(tui): conditionally render bash tool output (anomalyco#11558) * feat(tui): add UI for skill tool in session view (anomalyco#11561) * fix(tui): remove extra padding between search and results in dialog-select (anomalyco#11564) * fix: correct pluralization of match count in grep and glob tools (anomalyco#11565) * fix: ensure switching anthropic models mid convo on copilot works without errors, fix issue with reasoning opaque not being picked up for gemini models (anomalyco#11569) * fix(app): show retry status only on active turn (anomalyco#11543) * docs: improve zh-TW punctuation to match Taiwan usage (anomalyco#11574) (anomalyco#11589) * docs: add Turkish README translation (anomalyco#11524) * fix(app): use static language names in Thai localization (anomalyco#11496) * fix(app): binary file handling in file view (anomalyco#11312) * chore: generate * fix: allow user plugins to override built-in auth plugins (anomalyco#11058) Co-authored-by: JosXa <info@josxa.dev> * docs: prefer wsl over native windows stuff (anomalyco#11637) * fix(ecosystem): fix link Daytona (anomalyco#11621) * fix(tui): remove outer backtick wrapper in session transcript tool formatting (anomalyco#11566) Co-authored-by: Claude <noreply@anthropic.com> * fix: opencode hanging when using client.app.log() during initialization (anomalyco#11642) * fix: prevent duplicate AGENTS.md injection when reading instruction files (anomalyco#11581) Co-authored-by: Aiden Cline <aidenpcline@gmail.com> * fix(opencode): scope agent variant to model (anomalyco#11410) * chore: reduce nix fetching (anomalyco#11660) * chore: generate * fix(desktop): nix - add missing dep (anomalyco#11656) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> * fix: prompt caching for opus on bedrock (anomalyco#11664) * chore: update nix node_modules hashes * fix: variant logic for anthropic models through openai compat endpoint (anomalyco#11665) * fix: when using codex sub, send the custom agent prompts as a separate developer message (previously sent as user message but api allows for instructions AND developer messages) (anomalyco#11667) Co-authored-by: Carlos <carloscanas942@gmail.com> * test(app): workspace tests (anomalyco#11659) * docs (web): Update incorrect Kimi model name in zen.mdx (anomalyco#11677) * zen: add minimax logo (anomalyco#11682) * feat(ui): Select, dropdown, popover styles & transitions (anomalyco#11675) * chore: generate * feat(ui): Smooth fading out on scroll, style fixes (anomalyco#11683) * chore: generate * feat(app): show skill/mcp badges for slash commands Display 'skill' or 'mcp' badge instead of 'custom' for slash commands based on their source type. This provides better clarity to users about where each command comes from. * fix(app): hide badge for builtin slash commands Add source: 'command' to builtin and config-defined commands so they don't show a 'custom' badge. Only MCP and skill commands show badges. * fix: adjust resolve parts so that when messages with multiple @ references occur, the tool calls are properly ordered * test: add unit test * fix(plugin): correct exports to point to dist instead of src The package.json exports were pointing to ./src/*.ts but the published package only includes the dist/ folder. This caused 'Cannot find module' errors when custom tools tried to import @opencode-ai/plugin. Changed exports from: ".": "./src/index.ts" "./tool": "./src/tool.ts" To: ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } "./tool": { "types": "./dist/tool.d.ts", "import": "./dist/tool.js" } * ci: prevent rate limit errors when fetching team PRs for beta releases * ci: collect all failed PR merges and notify Discord * ci: add DISCORD_ISSUES_WEBHOOK_URL secret to beta workflow * ci: add --discord-webhook / -d CLI option for custom Discord webhook URL * ci: remove parseArgs CLI option and use environment variable directly * ci: rewrite beta script to use proper Bun shell patterns * ci: post PR comments when beta merge fails instead of Discord notifications * ci: add --label beta filter to only process PRs with beta label * ci: change trigger from scheduled cron to PR labeled events with beta label condition * ci: add synchronize event and check for beta label using contains() * ci: centralize team list in @opencode-ai/script package and use beta label filter * ci: run beta workflow on hourly schedule only * ci: allow manual dispatch for beta workflow * ci: skip force push when beta branch is unchanged * core: allow starting new sessions after errors by fixing stuck session status * tui: fix task status to show current tool state from message store * ci: skip unicode filename test due to inconsistent behavior causing CI failures * ignore: switch commit model to kimi-k2.5 for improved command execution reliability * ci: restrict nix-hashes workflow to dev branch pushes only Remove pull_request trigger and limit push trigger to dev branch to prevent unnecessary workflow runs on feature branches and PRs. The workflow will now only execute when dependency files change on the dev branch. * ci: Fix Pulumi version conflict in deploy workflow Added a workaround to fix Pulumi version conflict in the deployment workflow. * docs: Restructure AGENTS.md style guide with organized sections and code examples * Revert "fix(plugin): correct exports to point to dist instead of src" This reverts commit 7417e6e. * ci: enable typecheck on push to dev branch to catch type errors immediately after merge * Use opentui OSC52 clipboard (anomalyco#11718) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * Add spinner animation for Task tool (anomalyco#11725) * Simplify directory tree output for prompts (anomalyco#11731) * fix: session title generation with OpenAI models. (anomalyco#11678) * fix(opencode): give OPENCODE_CONFIG_CONTENT proper priority for setting config based on docs (anomalyco#11670) * Revert "Use opentui OSC52 clipboard (anomalyco#11718)" This reverts commit 8e985e0. * tui: show exit message banner (anomalyco#11733) * fix: convert system message content to string for Copilot provider (anomalyco#11600) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * Resolve catchup-001 app/ui conflict set * Fix app/desktop type drift in catchup batch 001 * Use GitHub-hosted Ubuntu runners for PR checks * Replace Blacksmith workflow runners with GitHub-hosted labels * Honor OPENCODE_DISABLE_PROJECT_CONFIG in config loading * Order turbo typecheck by dependency graph * Exit e2e seed script after completion * Default auth config to disabled * Run app e2e only in Linux test workflow * Align Playwright install cache with test runtime env * Respect disable-project-config in server auth loader * Fix app e2e local server cleanup * Default local e2e runner to disable project config --------- Co-authored-by: opencode <opencode@sst.dev> Co-authored-by: Hegyi Áron Ferenc <hegyi.aron101@gmail.com> Co-authored-by: Brendan Allan <git@brendonovich.dev> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Ryan Vogel <ryan@mandarin3d.com> Co-authored-by: Ravi Kumar <82090231+Raviguntakala@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com> Co-authored-by: Goni Zahavy <goni1993@gmail.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Frank <frank@anoma.ly> Co-authored-by: Spoon <212802214+spoons-and-mirrors@users.noreply.github.com> Co-authored-by: Dax <mail@thdxr.com> Co-authored-by: Mert Can Demir <validatedev@gmail.com> Co-authored-by: Filip <34747899+neriousy@users.noreply.github.com> Co-authored-by: Mikhail Levchenko <mishkun.lev@gmail.com> Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: Rahul A Mistry <149420892+ProdigyRahul@users.noreply.github.com> Co-authored-by: adamelmore <2363879+adamdottv@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Aaron Iker <aaron@anoma.ly> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: aaroniker <4730431+aaroniker@users.noreply.github.com> Co-authored-by: Idris Gadi <85882535+IdrisGit@users.noreply.github.com> Co-authored-by: Michael Yochpaz <myochpaz@redhat.com> Co-authored-by: Patrick Schiel <p.schiel@gmail.com> Co-authored-by: Cesar Garcia <128240629+Chesars@users.noreply.github.com> Co-authored-by: Benjamin Bartels <benjamin@bartels.dev> Co-authored-by: Steffen Deusch <steffen@deusch.me> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: Alex Yaroshuk <34632190+alexyaroshuk@users.noreply.github.com> Co-authored-by: 陆奕丞 <01luyicheng@gmail.com> Co-authored-by: Jérôme Benoit <jerome.benoit@piment-noir.org> Co-authored-by: 大猫子 <ll1042668699@gmail.com> Co-authored-by: damaozi <1811866786@qq.com> Co-authored-by: Jérôme Benoit <jerome.benoit@sap.com> Co-authored-by: adamjhf <50264672+adamjhf@users.noreply.github.com> Co-authored-by: Alper Kartkaya <114335677+AlperKartkaya@users.noreply.github.com> Co-authored-by: Joscha Götzer <joscha.goetzer@gmail.com> Co-authored-by: JosXa <info@josxa.dev> Co-authored-by: Axel Sarmiento Mrak <96851183+AxelMrak@users.noreply.github.com> Co-authored-by: zerone0x <hi@trine.dev> Co-authored-by: Desmond Sow <desmondsow@hotmail.com> Co-authored-by: YeonGyu-Kim <code.yeon.gyu@gmail.com> Co-authored-by: neavo <neavo@neavo.me> Co-authored-by: Caleb Norton <n0603919@outlook.com> Co-authored-by: Rohan Godha <git@rohangodha.com> Co-authored-by: Carlos <carloscanas942@gmail.com> Co-authored-by: Sumit Srivastava <sumitsrisumit@gmail.com> Co-authored-by: R44VC0RP <n01508660@unf.edu> Co-authored-by: Sebastian <hasta84@gmail.com> Co-authored-by: Mathias Beugnon <mathias@beugnon.fr> Co-authored-by: OpeOginni <107570612+OpeOginni@users.noreply.github.com> Co-authored-by: Jigar <jpatel4404@gmail.com>
1 parent 41731ed commit d77458a

File tree

685 files changed

+65927
-16486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

685 files changed

+65927
-16486
lines changed

.github/actions/setup-bun/action.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@ description: "Setup Bun with caching and install dependencies"
33
runs:
44
using: "composite"
55
steps:
6+
- name: Mount Bun Cache
7+
uses: useblacksmith/stickydisk@v1
8+
with:
9+
key: ${{ github.repository }}-bun-cache
10+
path: ~/.bun
11+
612
- name: Setup Bun
713
uses: oven-sh/setup-bun@v2
814
with:
915
bun-version-file: package.json
1016

11-
- name: Cache ~/.bun
12-
id: cache-bun
13-
uses: actions/cache@v4
14-
with:
15-
path: ~/.bun
16-
key: ${{ runner.os }}-bun-${{ hashFiles('package.json') }}-${{ hashFiles('bun.lockb', 'bun.lock') }}
17-
restore-keys: |
18-
${{ runner.os }}-bun-${{ hashFiles('package.json') }}-
19-
2017
- name: Install dependencies
2118
run: bun install
2219
shell: bash
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Setup Git Committer"
2+
description: "Create app token and configure git user"
3+
inputs:
4+
opencode-app-id:
5+
description: "OpenCode GitHub App ID"
6+
required: true
7+
opencode-app-secret:
8+
description: "OpenCode GitHub App private key"
9+
required: true
10+
outputs:
11+
token:
12+
description: "GitHub App token"
13+
value: ${{ steps.apptoken.outputs.token }}
14+
app-slug:
15+
description: "GitHub App slug"
16+
value: ${{ steps.apptoken.outputs.app-slug }}
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Create app token
21+
id: apptoken
22+
uses: actions/create-github-app-token@v2
23+
with:
24+
app-id: ${{ inputs.opencode-app-id }}
25+
private-key: ${{ inputs.opencode-app-secret }}
26+
owner: ${{ github.repository_owner }}
27+
28+
- name: Configure git user
29+
run: |
30+
slug="${{ steps.apptoken.outputs.app-slug }}"
31+
git config --global user.name "${slug}[bot]"
32+
git config --global user.email "${slug}[bot]@users.noreply.github.com"
33+
shell: bash
34+
35+
- name: Clear checkout auth
36+
run: |
37+
git config --local --unset-all http.https://github.com/.extraheader || true
38+
shell: bash
39+
40+
- name: Configure git remote
41+
run: |
42+
git remote set-url origin https://x-access-token:${{ steps.apptoken.outputs.token }}@github.com/${{ github.repository }}
43+
shell: bash

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
### What does this PR do?
22

3+
Please provide a description of the issue (if there is one), the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the pr.
4+
5+
**If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!**
6+
37
### How did you verify your code works?

.github/workflows/beta.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: beta
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 * * * *"
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Bun
21+
uses: ./.github/actions/setup-bun
22+
23+
- name: Setup Git Committer
24+
id: setup-git-committer
25+
uses: ./.github/actions/setup-git-committer
26+
with:
27+
opencode-app-id: ${{ vars.OPENCODE_APP_ID }}
28+
opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }}
29+
30+
- name: Sync beta branch
31+
env:
32+
GH_TOKEN: ${{ steps.setup-git-committer.outputs.token }}
33+
run: bun script/beta.ts
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: close-stale-prs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryRun:
7+
description: "Log actions without closing PRs"
8+
type: boolean
9+
default: false
10+
schedule:
11+
- cron: "0 6 * * *"
12+
13+
permissions:
14+
contents: read
15+
issues: write
16+
pull-requests: write
17+
18+
jobs:
19+
close-stale-prs:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Close inactive PRs
23+
uses: actions/github-script@v8
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
script: |
27+
const DAYS_INACTIVE = 60
28+
const cutoff = new Date(Date.now() - DAYS_INACTIVE * 24 * 60 * 60 * 1000)
29+
const { owner, repo } = context.repo
30+
const dryRun = context.payload.inputs?.dryRun === "true"
31+
32+
core.info(`Dry run mode: ${dryRun}`)
33+
core.info(`Cutoff date: ${cutoff.toISOString()}`)
34+
35+
const query = `
36+
query($owner: String!, $repo: String!, $cursor: String) {
37+
repository(owner: $owner, name: $repo) {
38+
pullRequests(first: 100, states: OPEN, after: $cursor) {
39+
pageInfo {
40+
hasNextPage
41+
endCursor
42+
}
43+
nodes {
44+
number
45+
title
46+
author {
47+
login
48+
}
49+
createdAt
50+
commits(last: 1) {
51+
nodes {
52+
commit {
53+
committedDate
54+
}
55+
}
56+
}
57+
comments(last: 1) {
58+
nodes {
59+
createdAt
60+
}
61+
}
62+
reviews(last: 1) {
63+
nodes {
64+
createdAt
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
`
72+
73+
const allPrs = []
74+
let cursor = null
75+
let hasNextPage = true
76+
77+
while (hasNextPage) {
78+
const result = await github.graphql(query, {
79+
owner,
80+
repo,
81+
cursor,
82+
})
83+
84+
allPrs.push(...result.repository.pullRequests.nodes)
85+
hasNextPage = result.repository.pullRequests.pageInfo.hasNextPage
86+
cursor = result.repository.pullRequests.pageInfo.endCursor
87+
}
88+
89+
core.info(`Found ${allPrs.length} open pull requests`)
90+
91+
const stalePrs = allPrs.filter((pr) => {
92+
const dates = [
93+
new Date(pr.createdAt),
94+
pr.commits.nodes[0] ? new Date(pr.commits.nodes[0].commit.committedDate) : null,
95+
pr.comments.nodes[0] ? new Date(pr.comments.nodes[0].createdAt) : null,
96+
pr.reviews.nodes[0] ? new Date(pr.reviews.nodes[0].createdAt) : null,
97+
].filter((d) => d !== null)
98+
99+
const lastActivity = dates.sort((a, b) => b.getTime() - a.getTime())[0]
100+
101+
if (!lastActivity || lastActivity > cutoff) {
102+
core.info(`PR #${pr.number} is fresh (last activity: ${lastActivity?.toISOString() || "unknown"})`)
103+
return false
104+
}
105+
106+
core.info(`PR #${pr.number} is STALE (last activity: ${lastActivity.toISOString()})`)
107+
return true
108+
})
109+
110+
if (!stalePrs.length) {
111+
core.info("No stale pull requests found.")
112+
return
113+
}
114+
115+
core.info(`Found ${stalePrs.length} stale pull requests`)
116+
117+
for (const pr of stalePrs) {
118+
const issue_number = pr.number
119+
const closeComment = `Closing this pull request because it has had no updates for more than ${DAYS_INACTIVE} days. If you plan to continue working on it, feel free to reopen or open a new PR.`
120+
121+
if (dryRun) {
122+
core.info(`[dry-run] Would close PR #${issue_number} from ${pr.author.login}: ${pr.title}`)
123+
continue
124+
}
125+
126+
await github.rest.issues.createComment({
127+
owner,
128+
repo,
129+
issue_number,
130+
body: closeComment,
131+
})
132+
133+
await github.rest.pulls.update({
134+
owner,
135+
repo,
136+
pull_number: issue_number,
137+
state: "closed",
138+
})
139+
140+
core.info(`Closed PR #${issue_number} from ${pr.author.login}: ${pr.title}`)
141+
}

.github/workflows/containers.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: containers
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- packages/containers/**
9+
- .github/workflows/containers.yml
10+
- package.json
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-24.04
20+
env:
21+
REGISTRY: ghcr.io/${{ github.repository_owner }}
22+
TAG: "24.04"
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: ./.github/actions/setup-bun
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Login to GHCR
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Build and push containers
42+
run: bun ./packages/containers/script/build.ts --push
43+
env:
44+
REGISTRY: ${{ env.REGISTRY }}
45+
TAG: ${{ env.TAG }}

0 commit comments

Comments
 (0)