Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 26 additions & 7 deletions .github/workflows/upstream-release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,38 @@ jobs:
REPO: ${{ steps.detect.outputs.repo }}
PREV: ${{ steps.detect.outputs.prev_tag }}
NEW: ${{ steps.detect.outputs.new_tag }}
REVIEW_REPO: ${{ github.repository }}
run: |
# Capture stderr separately so we can surface a missing-compare
# situation in the PR body rather than silently dropping reviewers.
# Get non-bot commit authors in the release range.
if COMPARE=$(gh api "repos/$REPO/compare/$PREV...$NEW" \
--jq '[.commits[].author.login? // empty] | unique | .[]' 2>/dev/null); then
REVIEWERS=$(echo "$COMPARE" |
grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' |
head -5 | paste -sd, -)
echo "compare_ok=true" >> "$GITHUB_OUTPUT"
else
REVIEWERS=""
COMPARE=""
echo "compare_ok=false" >> "$GITHUB_OUTPUT"
fi

# Filter out bot accounts, then further filter to only this
# repo's collaborators. GitHub rejects reviewer requests for
# non-collaborators with 422, which would fail the whole
# `gh pr edit --add-reviewer` call and drop the valid
# reviewers along with the invalid ones. Community
# contributors from the upstream repo often aren't
# collaborators here; silently skip them.
CANDIDATES=$(echo "$COMPARE" |
grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' || true)

REVIEWERS=""
while IFS= read -r login; do
[ -z "$login" ] && continue
if gh api "repos/$REVIEW_REPO/collaborators/$login" --silent 2>/dev/null; then
REVIEWERS="${REVIEWERS:+$REVIEWERS,}$login"
fi
done <<< "$CANDIDATES"

# Cap at 5 to avoid review fatigue.
REVIEWERS=$(echo "$REVIEWERS" | tr ',' '\n' | head -5 | paste -sd, -)

echo "list=$REVIEWERS" >> "$GITHUB_OUTPUT"
echo "Reviewers: ${REVIEWERS:-<none>}"

Expand Down Expand Up @@ -603,7 +622,7 @@ jobs:
echo "$GAPS_BLOCK"
echo ""
fi
echo "Reviewers below are non-bot commit authors in the release range."
echo "Reviewers below are non-bot commit authors in the release range who are also collaborators on this repo."
echo ""
echo "$END"
} > /tmp/section.md
Expand Down
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@
"matchManagers": ["custom.regex"],
"matchFileNames": ["**/.github/upstream-projects.yaml"],
"schedule": ["at any time"],
"minimumReleaseAge": "24 hours",
"minimumReleaseAge": "1 hour",
"minimumReleaseAgeBehaviour": "timestamp-optional",
"ignoreUnstable": true,
"rebaseWhen": "never",
"recreateWhen": "never",
"commitMessageTopic": "{{depName}}",
"prBodyNotes": [
"After this PR opens, `.github/workflows/upstream-release-docs.yml` adds source-verified content edits for the new release. For `stacklok/toolhive`, the same workflow also regenerates reference docs (CLI help, Swagger, CRD schemas)."
"After this PR opens, `.github/workflows/upstream-release-docs.yml` adds source-verified content edits for the new release. For `stacklok/toolhive`, the same workflow also syncs reference assets (CLI help, Swagger) and regenerates the CRD MDX pages."
]
}
]
Expand Down