Skip to content

The open-source app everyone uses to manage agents at work

fix: replace third-party action with gh CLI for lockfile PR creation

Dottaf32b76f21343
diff --git a/.github/workflows/refresh-lockfile.yml b/.github/workflows/refresh-lockfile.yml
index b0cfb78a64..604f394fa6 100644
--- a/.github/workflows/refresh-lockfile.yml
+++ b/.github/workflows/refresh-lockfile.yml
@@ -50,15 +50,31 @@ jobs:
exit 1
fi
- - name: Create pull request
- uses: peter-evans/create-pull-request@v7
- with:
- commit-message: "chore(lockfile): refresh pnpm-lock.yaml"
- branch: chore/refresh-lockfile
- delete-branch: true
- title: "chore(lockfile): refresh pnpm-lock.yaml"
- body: |
- Auto-generated lockfile refresh after dependencies changed on `master`.
+ - name: Create or update pull request
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ if git diff --quiet -- pnpm-lock.yaml; then
+ echo "Lockfile unchanged, nothing to do."
+ exit 0
+ fi
+
+ BRANCH="chore/refresh-lockfile"
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git checkout -B "$BRANCH"
+ git add pnpm-lock.yaml
+ git commit -m "chore(lockfile): refresh pnpm-lock.yaml"
+ git push -f origin "$BRANCH"
- This PR only updates `pnpm-lock.yaml` — no source changes.
- labels: lockfile-bot
+ # Create PR if one doesn't already exist for this branch
+ existing=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number')
+ if [ -n "$existing" ]; then
+ echo "PR #$existing already exists for $BRANCH, updated branch."
+ else
+ gh pr create \
+ --head "$BRANCH" \
+ --title "chore(lockfile): refresh pnpm-lock.yaml" \
+ --body "Auto-generated lockfile refresh after dependencies changed on \`master\`.\n\nThis PR only updates \`pnpm-lock.yaml\` — no source changes."
+ echo "Created new PR."
+ fi