From 92b13153e9d28f4f3ffc062df6904c2553210b39 Mon Sep 17 00:00:00 2001 From: Hari <73809867+harivansh-afk@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:06:14 -0400 Subject: [PATCH] fix sync script bugs, remove auto-merge workflow (#36) - Fix jq pipe precedence: wrap uris length check in parens so `length` applies to the array, not the boolean and-chain - Fix while-loop subshell: use process substitution so counter variables persist to the final summary line - Remove auto-merge workflow: GITHUB_TOKEN merges do not trigger push events, so deploy-netty never ran on auto-merged PRs --- .github/workflows/auto-merge.yml | 21 --------------------- scripts/sync-bw-browser-auth.sh | 6 +++--- 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/auto-merge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml deleted file mode 100644 index 81c596c..0000000 --- a/.github/workflows/auto-merge.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: auto-merge - -on: - pull_request: - types: [opened, synchronize, reopened] - branches: [main] - -permissions: - contents: write - pull-requests: write - -jobs: - enable-auto-merge: - runs-on: ubuntu-latest - steps: - - name: Enable auto-merge - run: gh pr merge --auto --squash "$PR_NUMBER" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} diff --git a/scripts/sync-bw-browser-auth.sh b/scripts/sync-bw-browser-auth.sh index d019a79..382defc 100755 --- a/scripts/sync-bw-browser-auth.sh +++ b/scripts/sync-bw-browser-auth.sh @@ -34,7 +34,7 @@ login_items="$(printf '%s' "${items_json}" | jq -c ' .login.username != "" and .login.password != null and .login.password != "" and - (.login.uris // []) | length > 0 + ((.login.uris // []) | length) > 0 )] ')" @@ -45,7 +45,7 @@ imported=0 skipped=0 failed=0 -printf '%s' "${login_items}" | jq -c '.[]' | while IFS= read -r item; do +while IFS= read -r item; do name="$(printf '%s' "${item}" | jq -r '.name')" username="$(printf '%s' "${item}" | jq -r '.login.username')" password="$(printf '%s' "${item}" | jq -r '.login.password')" @@ -82,6 +82,6 @@ printf '%s' "${login_items}" | jq -c '.[]' | while IFS= read -r item; do printf 'FAIL: %s (%s)\n' "${safe_name}" "${uri}" >&2 failed=$((failed + 1)) fi -done +done < <(printf '%s' "${login_items}" | jq -c '.[]') printf '\nDone. imported=%d skipped=%d failed=%d\n' "${imported}" "${skipped}" "${failed}"