mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 07:04:47 +00:00
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
This commit is contained in:
parent
e634a3e233
commit
92b13153e9
2 changed files with 3 additions and 24 deletions
21
.github/workflows/auto-merge.yml
vendored
21
.github/workflows/auto-merge.yml
vendored
|
|
@ -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 }}
|
|
||||||
|
|
@ -34,7 +34,7 @@ login_items="$(printf '%s' "${items_json}" | jq -c '
|
||||||
.login.username != "" and
|
.login.username != "" and
|
||||||
.login.password != null and
|
.login.password != null and
|
||||||
.login.password != "" and
|
.login.password != "" and
|
||||||
(.login.uris // []) | length > 0
|
((.login.uris // []) | length) > 0
|
||||||
)]
|
)]
|
||||||
')"
|
')"
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ imported=0
|
||||||
skipped=0
|
skipped=0
|
||||||
failed=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')"
|
name="$(printf '%s' "${item}" | jq -r '.name')"
|
||||||
username="$(printf '%s' "${item}" | jq -r '.login.username')"
|
username="$(printf '%s' "${item}" | jq -r '.login.username')"
|
||||||
password="$(printf '%s' "${item}" | jq -r '.login.password')"
|
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
|
printf 'FAIL: %s (%s)\n' "${safe_name}" "${uri}" >&2
|
||||||
failed=$((failed + 1))
|
failed=$((failed + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done < <(printf '%s' "${login_items}" | jq -c '.[]')
|
||||||
|
|
||||||
printf '\nDone. imported=%d skipped=%d failed=%d\n' "${imported}" "${skipped}" "${failed}"
|
printf '\nDone. imported=%d skipped=%d failed=%d\n' "${imported}" "${skipped}" "${failed}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue