Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh api /rate_limit | jq

- name: Requesting code owner reviews
- name: Determining code owner reviews
if: steps.app-token.outputs.token
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REPOSITORY: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
# Don't do anything on draft PRs
DRY_MODE: ${{ github.event.pull_request.draft && '1' || '' }}
run: result/bin/request-code-owner-reviews.sh "$REPOSITORY" "$NUMBER" ci/OWNERS
run: |
result/bin/request-code-owner-reviews.sh "$REPOSITORY" "$NUMBER" ci/OWNERS > owners.txt

- name: Log current API rate limits (app-token)
if: ${{ steps.app-token.outputs.token }}
Expand Down Expand Up @@ -149,7 +148,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: gh api /rate_limit | jq

- name: Requesting maintainer reviews
- name: Requesting reviews
if: ${{ steps.app-token.outputs.token }}
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -164,6 +163,7 @@ jobs:
# There appears to be no API to request reviews based on GitHub IDs
jq -r 'keys[]' comparison/maintainers.json \
| while read -r id; do gh api /user/"$id" --jq .login; done \
| cat owners.txt - \
| GH_TOKEN="$APP_GH_TOKEN" result/bin/request-reviewers.sh "$REPOSITORY" "$NUMBER" "$AUTHOR"

- name: Log current API rate limits (app-token)
Expand Down
5 changes: 1 addition & 4 deletions ci/request-reviews/request-code-owner-reviews.sh
Comment thread
wolfgangwalther marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ prRepo=$(jq -r .head.repo.full_name <<< "$prInfo")
log "PR repo: $prRepo"
prBranch=$(jq -r .head.ref <<< "$prInfo")
log "PR branch: $prBranch"
prAuthor=$(jq -r .user.login <<< "$prInfo")
log "PR author: $prAuthor"

extraArgs=()
if pwdRepo=$(git rev-parse --show-toplevel 2>/dev/null); then
Expand All @@ -56,5 +54,4 @@ git -C "$tmp/nixpkgs.git" fetch --no-tags fork "$prBranch"
headRef=$(git -C "$tmp/nixpkgs.git" rev-parse refs/remotes/fork/"$prBranch")

log "Requesting reviews from code owners"
"$SCRIPT_DIR"/get-code-owners.sh "$tmp/nixpkgs.git" "$ownersFile" "$baseBranch" "$headRef" | \
"$SCRIPT_DIR"/request-reviewers.sh "$baseRepo" "$prNumber" "$prAuthor"
"$SCRIPT_DIR"/get-code-owners.sh "$tmp/nixpkgs.git" "$ownersFile" "$baseBranch" "$headRef"
2 changes: 1 addition & 1 deletion ci/request-reviews/request-reviewers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ for user in "${!users[@]}"; do
fi
done

if [[ "${#users[@]}" -gt 10 ]]; then
if [[ "${#users[@]}" -gt 15 ]]; then
log "Too many reviewers (${!users[*]}), skipping review requests"
exit 0
fi
Expand Down