Skip to content

Commit 9b432b2

Browse files
committed
ci: use claude code to fix upgrade issues
1 parent a380e35 commit 9b432b2

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/upgrade-deps.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
actions: read
1617
steps:
1718
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1819
- uses: ./.github/actions/clone
@@ -24,6 +25,7 @@ jobs:
2425
with:
2526
save-cache: ${{ github.ref_name == 'main' }}
2627
cache-key: upgrade-deps
28+
tools: just,cargo-shear
2729

2830
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
2931

@@ -50,8 +52,34 @@ jobs:
5052
5153
- name: Build
5254
uses: ./.github/actions/build-upstream
55+
id: build-upstream
56+
continue-on-error: true
5357
with:
5458
target: x86_64-unknown-linux-gnu
59+
60+
- uses: anthropics/claude-code-action@a017b830c03e23789b11fb69ed571ea61c12e45c # v1.0.0
61+
if: steps.build-upstream.outcome == 'failure'
62+
with:
63+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
64+
prompt: |
65+
Check why the build-upstream steps failed and fix them.
66+
### Background
67+
- The build-upstream steps are at ./.github/actions/build-upstream/action.yml
68+
- The deps upgrade script is at ./.github/scripts/upgrade-deps.mjs
69+
70+
### Instructions
71+
- We are using `pnpm` as the package manager
72+
- We are aiming to upgrade all dependencies to the latest versions in this workflow, so don't downgrade any dependencies.
73+
- If deps in our `Cargo.toml` need to be upgraded, you can refer to the `./.claude/agents/cargo-workspace-merger.md`
74+
- If `Cargo.toml` has been modified, you need to run `cargo shear` to ensure there is nothing wrong with our dependencies.
75+
- Run the steps in `build-upstream` action.yml after your fixing. If no errors are found, you can safe to exit.
76+
77+
Help me fix the errors in `build-upstream` steps, no need to commit changes after your fixing.
78+
claude_args: |
79+
--allowedTools "Bash,Edit,Replace,NotebookEditCell"
80+
additional_permissions: |
81+
actions: read
82+
5583
5684
- name: Update lockfile
5785
run: |

0 commit comments

Comments
 (0)