-
Notifications
You must be signed in to change notification settings - Fork 0
ci(repo-settings): use squash-merge only for clean release-please changelogs #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cbrgm
wants to merge
1
commit into
main
Choose a base branch
from
ci/repo-settings-squash-only
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
rg -n '^\s+-f (allow_merge_commit|allow_squash_merge|allow_rebase_merge|delete_branch_on_merge|allow_auto_merge)=' common.mkRepository: opendefensecloud/dev-kit
Length of output: 354
🏁 Script executed:
Repository: opendefensecloud/dev-kit
Length of output: 1832
🌐 Web query:
GitHub CLI gh api -f vs -F raw-field typed-field boolean fields💡 Result:
In the GitHub CLI (gh), the --field (-F) and --raw-field (-f) flags behave differently regarding how they handle data types like booleans and numbers [1][2]. --field (-F) (Typed Field): This flag supports magic type conversion based on the value provided [1]. When you use -F, the GitHub CLI attempts to interpret specific literal values as their corresponding JSON types [1]. - Booleans: Values like true and false are automatically converted to JSON boolean types [1]. - Numbers: Integer numbers are converted to JSON number types [1]. - Null: The value null is converted to a JSON null type [1]. --raw-field (-f) (Raw Field): This flag treats all values as static strings [1][2]. It does not perform any automatic type conversion or JSON parsing on the value [2]. If you need a value to be treated strictly as a string—even if it looks like a boolean or number—you should use --raw-field [2]. Summary of Key Differences: - Use --field (-F) when you want the CLI to automatically handle JSON type conversion for booleans, numbers, and null values [1]. - Use --raw-field (-f) when you want to ensure the value is sent as a string [2]. - For complex data structures such as nested objects or arrays, neither flag is typically sufficient on its own [3][4]. In such cases, the recommended practice is to prepare the full JSON payload externally and pass it to the command using --input - (reading from standard input) or a file [1][3][4]. Example Usage: # Using -F for automatic type conversion (sends JSON boolean) gh api -X PATCH /repos/{owner}/{repo} -F archived=true # Using -f for string-only (sends "true" as a string, if the API expects a string) gh api -X PATCH /repos/{owner}/{repo} -f archived="true"
Citations:
gh apicli/cli#1484🌐 Web query:
GitHub REST API update repository PATCH body allows auto merge allow squash merge merge commit true false boolean💡 Result:
The GitHub REST API update repository endpoint (PATCH /repos/{owner}/{repo}) supports the following boolean parameters to control merge settings, which must be passed in the request body [1]: - allow_squash_merge (boolean): Set to true to allow squash-merging pull requests, or false to prevent it. The default value is true [1]. - allow_merge_commit (boolean): Set to true to allow merging pull requests with a merge commit, or false to prevent it. The default value is true [1]. - allow_auto_merge (boolean): Set to true to allow auto-merge on pull requests, or false to disallow it. The default value is false [1]. These parameters allow you to programmatically toggle repository merge configurations by sending the desired boolean value in your JSON request body [1].
Citations:
🌐 Web query:
GitHub REST API update repository PATCH allow_rebase_merge boolean merge commit💡 Result:
To update repository settings using the GitHub REST API, you can use the PATCH /repos/{owner}/{repo} endpoint [1][2]. The allow_rebase_merge parameter is a boolean value that controls whether rebase-merging of pull requests is enabled for the repository [1][3]. Setting this to true allows rebase-merging, while false prevents it [1][4]. The default value for this setting is true [1][3]. When updating repository merge settings, you can also configure related options using the same PATCH endpoint, such as: allow_merge_commit (boolean): Enables or disables merging pull requests with a merge commit (default: true) [3][2]. allow_squash_merge (boolean): Enables or disables squash-merging of pull requests (default: true) [2][5]. For example, a JSON request body to update these settings would look like this: { "allow_merge_commit": true, "allow_squash_merge": true, "allow_rebase_merge": false } Note that managing repository merge settings requires the contents:read and contents:write permissions [2][5]. While this PATCH endpoint manages overall repository settings, actual pull request merges are performed using the PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge endpoint, which accepts a merge_method parameter (merge, squash, or rebase) [6].
Citations:
Use typed fields for boolean repository settings.
gh api -f/--raw-fieldsends literal string values, but the repository PATCH fields here are defined as booleans. Use-F/--typed-fieldsofalse/trueare serialized as JSON booleans; otherwise the settings update can fail validation.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents