Commit graph

37 commits

Author SHA1 Message Date
yuvrajangadsingh
198487e166 fix: address review feedback on squash merge commit message
- reorder if checks: validate --enable-squash-merge is set before
  checking the value, and error when --enable-squash-merge=false
- use validSquashMsgValues directly in interactive prompt instead of
  duplicating the slice
- use slices.Contains in validateSquashMergeCommitMsg
- interpolate const values in Long description instead of hardcoding
- add default clause in transformSquashMergeOpts to avoid mutating
  title/message on unknown input
- move optionDiscussions to end of const block with TODO comment
- add test for unknown input and --enable-squash-merge=false case
2026-03-10 18:27:21 +05:30
yuvrajangadsingh
3baf83a339 fix: gofmt alignment in test struct literals 2026-03-10 16:55:50 +05:30
yuvrajangadsingh
4ae0c5851b feat(repo): add --squash-merge-commit-message flag to gh repo edit
Add a single --squash-merge-commit-message flag that maps to both
squash_merge_commit_title and squash_merge_commit_message API fields.

Supported values:
- default: COMMIT_OR_PR_TITLE + COMMIT_MESSAGES
- pr-title: PR_TITLE + BLANK
- pr-title-commits: PR_TITLE + COMMIT_MESSAGES
- pr-title-description: PR_TITLE + PR_BODY

The flag requires --enable-squash-merge to be set alongside it. In
interactive mode, the squash merge commit message prompt appears when
squash merging is selected.

Closes #10092
2026-03-10 16:55:50 +05:30
Kynan Ware
9de48154de Add missing TODO comments for featuredetection if-statements
Add greppable TODO identifiers above all if-statements that reference
featuredetection struct fields, as required by the featuredetection
linter. This ensures every feature detection branch is tagged for
future cleanup when GHES gains support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-16 14:24:32 -07:00
Babak K. Shandiz
9f65e89760
fix: close resp body (bodyclose)
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:25 +00:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
Kynan Ware
ae20633ba6
Revert "[gh repo edit] Allow setting commit message defaults" 2025-02-04 13:55:37 -07:00
Azeem Sajid
e144168dde [gh repo edit] Allow setting commit title defaults 2025-02-03 15:26:05 +05:00
Tyler McGoffin
576fa8a3bc
Add test for permissions check for security and analysis edits (#1) 2025-01-03 01:29:45 -05:00
ChandranshuRao14
079719f923 Move api call to editRun 2024-12-31 00:47:05 -05:00
ChandranshuRao14
29371e9491 Extract logic into helper function 2024-12-26 22:52:32 -05:00
ChandranshuRao14
a542011cdc Feat: Allow setting security_and_analysis settings in gh repo edit 2024-12-24 12:59:42 -06:00
Andy Feller
3f5fc85e41 Assert stderr for gh repo edit visibility tests 2024-10-30 13:31:00 -04:00
Andy Feller
15b2db9277 Require visibility confirmation in gh repo edit
This commit modifies interactive and non-interactive behaviors around `gh repo edit` as well as providing greater information about the impact.

1. `--help` usage is expanded to highlight the most significant consequences of changing visibility
1. `--help` usage and interactive experience call out GitHub Docs content that act as source of truth about full consequences of various changes
1. `gh repo edit` interactive experience will require confirmation for any visibility change
1. `gh repo edit` interactive experience will output potential stars and watchers lose regardless of visibility transition
1. `gh repo edit` will require `--visibility` flag to include new `--accept-visibility-change-consequences` flag regardless of interactivity
2024-10-29 10:25:04 -04:00
Yukai Chou
17d336e005 Wrap cli flags in backticks uniformly 2023-11-16 22:54:27 +08:00
Nate Smith
f5477d931b pass prompter around instead of opts 2023-08-10 17:34:17 -07:00
Nate Smith
480505511c test for forking in org 2023-08-08 17:53:21 -07:00
Nate Smith
3e2f09d970 strip more dead code 2023-08-08 17:35:35 -07:00
Nate Smith
c1296194ee port more prompts and cover with new tests 2023-08-08 17:28:06 -07:00
Nate Smith
8927040028 remove dead code 2023-08-08 15:58:16 -07:00
Nate Smith
bd12522cb2 finish porting existing tests 2023-08-08 15:37:58 -07:00
Nate Smith
aed3a67749 WIP porting repo edit to opts.Prompter 2023-08-07 17:59:56 -07:00
Nate Smith
cd65409328 switch to Prompter.MultiSelect 2023-08-07 17:12:46 -07:00
Sam Coe
801c38a24f
Add visibility warning to repo edit (#6980)
Add visibility warning to repo edit

---------

Co-authored-by: Lai Tuan Anh <laituananh1711@gmail.com>
2023-02-08 08:53:22 +11:00
azu
700bda3ad8
Add gh repo edit --enable-discussions (#6903)
* Add gh repo edit --enable-discussions
* Add hasDiscussionsEnabled to JSON fields for repos

Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-01-24 18:13:05 +01:00
Bruno Alla
25209ad6b1 Add --allow-update-branch to the repo edit command 2022-12-08 20:19:14 +00:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
vilmibm
d5334f4115 Revert "update linter checks"
This reverts commit 40ecb8c188.
2022-07-27 13:30:41 -05:00
vilmibm
40ecb8c188 update linter checks 2022-07-26 16:06:52 -05:00
Patrick Reader
0cf2600725
strip whitespace when adding topics
closes #5934
2022-07-14 13:17:40 +01:00
Sam Coe
074ed50b8a
Integrate go-gh API package (#5614) 2022-06-23 04:05:31 +01:00
Mislav Marohnić
80f130184c repo edit: fix interactive mode in GHES < 3.3 2022-06-07 17:54:52 +02:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Gowtham Munukutla
83a6cccf2a
Add interactive repository edit functionality (#4895) 2022-03-14 17:49:03 +00:00
Breno Silva
6e14426dfb
docs: improve repo edit docs (#5165)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-02-15 17:35:30 +01:00
Mislav Marohnić
7d199fa783 repo edit: add ability to add or remove repository topics 2021-12-07 19:28:29 +01:00
Gowtham Munukutla
98217fc38c gh repo edit
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-07 19:28:29 +01:00