Skip to content

feat: set repo settings in one gh repo edit call - #77

Open
sbp-bvanb wants to merge 1 commit into
mainfrom
feat-66-single-repo-edit
Open

sbp-bvanb wants to merge 1 commit into
mainfrom
feat-66-single-repo-edit

Conversation

@sbp-bvanb

Copy link
Copy Markdown
Collaborator

What and why

  • Merges the eight single-flag gh repo edit steps (description, delete branch on merge, discussions, rebase/squash/merge-commit, projects, wiki) into one gh repo edit step. gh repo edit sends one PATCH, so GitHub validates the merge methods together. This should fix the Repository.merge_commit_allowed is invalid 422 from HTTP 422: Validation Failed #43, which happened when a step left zero merge methods enabled partway through.
  • The step now fails early with a clear error if settings_merge_commit, settings_merge_rebase and settings_merge_squash are all false.
  • New input settings_homepage (set website url for a project #42): passed as --homepage. Empty (the default) leaves the homepage unchanged.
  • New input settings_issues (Add settings_issues input to enable/disable the Issues tab #44): passed as --enable-issues. The default is true, not false like settings_wiki/settings_projects. Until now the action never touched Issues. A false default would turn Issues off, and hide existing issues, in every repository that upgrades.
  • Both inputs are documented in docs/inputs.md, with a note on the merge-method check.
  • The topics step stays separate; [Should fix] Topics are only added, never removed #67 changes it in its own PR.

Testing

  • action.yml parses as YAML, and bash -n passes on the extracted script of the new step.
  • I ran the extracted script with a stub gh that prints its arguments. It built one gh repo edit with all flags, added --homepage only when set, and exited 1 with the error when all merge methods were false.
  • pytest (test.py) passes: 6 tests.
  • Not tested: I could not run the action against a real repository. Whether one combined PATCH avoids the 422 is reasoned from how gh repo edit works, not tested live.
  • The general/PR-validation checks on this fork end in startup_failure because the fork's Actions policy blocks schubergphilis/* actions. That happens on every PR here, not because of this change.

Closes #66
Closes #43
Closes #42
Closes #44

🤖 Generated with Claude Code

Merge the eight single-flag gh repo edit steps into one step, so
GitHub validates the merge methods together instead of rejecting an
intermediate state with none enabled (HTTP 422). Fail early when all
three merge methods are false.

Add the settings_homepage input (empty leaves the homepage unchanged)
and the settings_issues input (default true, as on GitHub).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant