From b5fab91ac44691748e29ae8ee976d36920ce9968 Mon Sep 17 00:00:00 2001 From: Andreas Richardson Date: Sun, 29 Nov 2026 22:51:27 +0000 Subject: [PATCH 1/3] feat(configure): note missing repository profile parts in --diff For a public repo, --diff now prints a note: line for no description, a topic count outside five to ten, a missing or self-pointing homepage, no custom social preview, and a README without the banner. Notes never change the exit status, since --apply can fix none of them. Co-Authored-By: Claude Opus 5.5 --- STANDARDS.md | 6 +++++ scripts/configure.sh | 57 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/STANDARDS.md b/STANDARDS.md index 27eb164..c7b086e 100644 --- a/STANDARDS.md +++ b/STANDARDS.md @@ -487,6 +487,12 @@ Settings, General, Social preview. Description, topics and homepage are set with `gh repo edit`. Those three are not tracked as files: GitHub's About box already holds them, and a copy in the repo would drift from it. +`configure.sh --diff` notes each part a public repo is missing: no +description, a topic count outside five to ten, no homepage while it publishes a +package, or the repo's own URL as homepage, no custom social preview, and a +README without the banner. These are `note:` lines, not drift, and never fail +`--diff`, since `--apply` could fix none of them. + ## Markdown markdownlint-cli2 and mdformat, both run by `markdown.yml`. mdformat owns diff --git a/scripts/configure.sh b/scripts/configure.sh index a76301a..ddd7394 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -18,7 +18,8 @@ # --diff compares the repo's live merge and Actions settings with settings/, # reports classic branch protection, which the ruleset does not replace, # checks the release tag ruleset in a public repo, and checks the branch policy -# of each publishing environment the workflows name. +# of each publishing environment the workflows name. In a public repo it then +# notes each part of the repository profile that is missing, without failing. # Actions may open PRs only in a repo whose workflows run release-please. # Needs an authenticated gh. Written for bash 3.2 (macOS's stock /bin/bash). @@ -330,6 +331,58 @@ check_environment() { " } +# Notes on the repository profile (STANDARDS.md, Repository profile), one +# `note:` line for each part a public repo is missing. Advice, not drift: the +# words are the owner's to write and GitHub has no API for the social preview, +# so --apply could not fix any of it, and none of it changes the exit status. +# A read that fails says so on stderr and skips that part, never failing --diff. +profile_notes() { + [ "$visibility" = public ] || return 0 + local about description homepage topics custom readme banner + banner=.github/social/social-preview-banner.png + if ! about=$(gh api "repos/$repo" --jq '[.description // "", .homepage // "", (.topics // [] | length)] | @tsv'); then + echo "note: could not read $repo's About box" >&2 + return 0 + fi + description=$(printf '%s' "$about" | cut -f1) + homepage=$(printf '%s' "$about" | cut -f2) + topics=$(printf '%s' "$about" | cut -f3) + [ -n "$description" ] || echo "note: no description" + if [ "${topics:-0}" -lt 5 ] || [ "${topics:-0}" -gt 10 ]; then + echo "note: ${topics:-0} topics, STANDARDS.md asks for 5 to 10" + fi + case "$homepage" in + "https://github.com/$repo" | "https://github.com/$repo/") + echo "note: homepage is the repo's own URL; use its registry page or docs site, or leave it empty" + ;; + "") + if names_environment npm-release || names_environment pypi; then + echo "note: no homepage, though it publishes a package; use its registry page" + fi + ;; + esac + # shellcheck disable=SC2016 # $owner and $name are GraphQL variables. + if custom=$(gh api graphql -F owner="${repo%%/*}" -F name="${repo#*/}" \ + -f query='query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { usesCustomOpenGraphImage } }' \ + --jq .data.repository.usesCustomOpenGraphImage); then + [ "$custom" = true ] || + echo "note: no custom social preview; upload one under Settings, General, Social preview" + else + echo "note: could not check $repo's social preview" >&2 + fi + # Only a 404 means there is no README; any other failure is unknown. + if readme=$(gh api "repos/$repo/readme" --jq .content 2>"$api_error"); then + case "$(printf '%s' "$readme" | base64 --decode)" in + *"$banner"*) ;; + *) echo "note: README does not open with the banner at $banner" ;; + esac + elif grep 'HTTP 404' "$api_error" >/dev/null; then + echo "note: no README" + else + echo "note: could not read $repo's README" >&2 + fi +} + if [ "$mode" = --diff ]; then # Command substitution drops trailing newlines, so print each part rather # than concatenating them. @@ -361,9 +414,11 @@ if [ "$mode" = --diff ]; then [ -z "$classic" ] || echo "$classic" [ -z "$tags" ] || echo "$tags" [ -z "$environment_drift" ] || printf '%s' "$environment_drift" + profile_notes exit 1 fi echo "$repo matches settings/ (release-please: $uses_release_please)" + profile_notes exit 0 fi From f5bf4ee51473693bed9155bbecf5edcefa6a7436 Mon Sep 17 00:00:00 2001 From: Andreas Richardson Date: Sun, 29 Nov 2026 23:11:03 +0000 Subject: [PATCH 2/3] fix(configure): keep checking the profile after an About box read fails Co-Authored-By: Claude Opus 5.5 --- scripts/configure.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/configure.sh b/scripts/configure.sh index ddd7394..0641e06 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -340,27 +340,27 @@ profile_notes() { [ "$visibility" = public ] || return 0 local about description homepage topics custom readme banner banner=.github/social/social-preview-banner.png - if ! about=$(gh api "repos/$repo" --jq '[.description // "", .homepage // "", (.topics // [] | length)] | @tsv'); then + if about=$(gh api "repos/$repo" --jq '[.description // "", .homepage // "", (.topics // [] | length)] | @tsv'); then + description=$(printf '%s' "$about" | cut -f1) + homepage=$(printf '%s' "$about" | cut -f2) + topics=$(printf '%s' "$about" | cut -f3) + [ -n "$description" ] || echo "note: no description" + if [ "${topics:-0}" -lt 5 ] || [ "${topics:-0}" -gt 10 ]; then + echo "note: ${topics:-0} topics, STANDARDS.md asks for 5 to 10" + fi + case "$homepage" in + "https://github.com/$repo" | "https://github.com/$repo/") + echo "note: homepage is the repo's own URL; use its registry page or docs site, or leave it empty" + ;; + "") + if names_environment npm-release || names_environment pypi; then + echo "note: no homepage, though it publishes a package; use its registry page" + fi + ;; + esac + else echo "note: could not read $repo's About box" >&2 - return 0 - fi - description=$(printf '%s' "$about" | cut -f1) - homepage=$(printf '%s' "$about" | cut -f2) - topics=$(printf '%s' "$about" | cut -f3) - [ -n "$description" ] || echo "note: no description" - if [ "${topics:-0}" -lt 5 ] || [ "${topics:-0}" -gt 10 ]; then - echo "note: ${topics:-0} topics, STANDARDS.md asks for 5 to 10" fi - case "$homepage" in - "https://github.com/$repo" | "https://github.com/$repo/") - echo "note: homepage is the repo's own URL; use its registry page or docs site, or leave it empty" - ;; - "") - if names_environment npm-release || names_environment pypi; then - echo "note: no homepage, though it publishes a package; use its registry page" - fi - ;; - esac # shellcheck disable=SC2016 # $owner and $name are GraphQL variables. if custom=$(gh api graphql -F owner="${repo%%/*}" -F name="${repo#*/}" \ -f query='query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { usesCustomOpenGraphImage } }' \ From be5b32379f7d95c5092a7ce10d106e1cabcadedd Mon Sep 17 00:00:00 2001 From: Andreas Richardson Date: Sun, 29 Nov 2026 23:22:34 +0000 Subject: [PATCH 3/3] fix(configure): match the homepage in any case and send names as strings Co-Authored-By: Claude Opus 5.5 --- scripts/configure.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/configure.sh b/scripts/configure.sh index 0641e06..9cdd678 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -338,7 +338,7 @@ check_environment() { # A read that fails says so on stderr and skips that part, never failing --diff. profile_notes() { [ "$visibility" = public ] || return 0 - local about description homepage topics custom readme banner + local about description homepage own topics custom readme banner banner=.github/social/social-preview-banner.png if about=$(gh api "repos/$repo" --jq '[.description // "", .homepage // "", (.topics // [] | length)] | @tsv'); then description=$(printf '%s' "$about" | cut -f1) @@ -348,8 +348,10 @@ profile_notes() { if [ "${topics:-0}" -lt 5 ] || [ "${topics:-0}" -gt 10 ]; then echo "note: ${topics:-0} topics, STANDARDS.md asks for 5 to 10" fi - case "$homepage" in - "https://github.com/$repo" | "https://github.com/$repo/") + # GitHub matches owner and repo names in any case. + own=$(printf '%s' "https://github.com/$repo" | tr '[:upper:]' '[:lower:]') + case "$(printf '%s' "$homepage" | tr '[:upper:]' '[:lower:]')" in + "$own" | "$own/") echo "note: homepage is the repo's own URL; use its registry page or docs site, or leave it empty" ;; "") @@ -362,7 +364,7 @@ profile_notes() { echo "note: could not read $repo's About box" >&2 fi # shellcheck disable=SC2016 # $owner and $name are GraphQL variables. - if custom=$(gh api graphql -F owner="${repo%%/*}" -F name="${repo#*/}" \ + if custom=$(gh api graphql -f owner="${repo%%/*}" -f name="${repo#*/}" \ -f query='query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { usesCustomOpenGraphImage } }' \ --jq .data.repository.usesCustomOpenGraphImage); then [ "$custom" = true ] ||