mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
Add skip_ci_on_push configuration option for changelog updates
This commit is contained in:
@ -15,6 +15,7 @@ It can be invoked manually by commenting on any PR:
|
|||||||
|
|
||||||
Under the section `pr_update_changelog`, the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
|
Under the section `pr_update_changelog`, the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
|
||||||
|
|
||||||
- `push_changelog_changes`: whether to push the changes to CHANGELOG.md, or just print them. Default is false (print only).
|
- `push_changelog_changes`: whether to push the changes to CHANGELOG.md, or just publish them as a comment. Default is false (publish as comment).
|
||||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...
|
- `extra_instructions`: Optional extra instructions to the tool. For example: "Use the following structure: ..."
|
||||||
- `add_pr_link`: whether the model should try to add a link to the PR in the changelog. Default is true.
|
- `add_pr_link`: whether the model should try to add a link to the PR in the changelog. Default is true.
|
||||||
|
- `skip_ci_on_push`: whether the commit message (when `push_changelog_changes` is true) will include the term "[skip ci]", preventing CI tests to be triggered on the changelog commit. Default is true.
|
@ -182,6 +182,7 @@ class_name = "" # in case there are several methods with the same name in
|
|||||||
push_changelog_changes=false
|
push_changelog_changes=false
|
||||||
extra_instructions = ""
|
extra_instructions = ""
|
||||||
add_pr_link=true
|
add_pr_link=true
|
||||||
|
skip_ci_on_push=true
|
||||||
|
|
||||||
[pr_analyze] # /analyze #
|
[pr_analyze] # /analyze #
|
||||||
enable_help_text=true
|
enable_help_text=true
|
||||||
|
@ -140,11 +140,15 @@ class PRUpdateChangelog:
|
|||||||
return new_file_content, answer
|
return new_file_content, answer
|
||||||
|
|
||||||
def _push_changelog_update(self, new_file_content, answer):
|
def _push_changelog_update(self, new_file_content, answer):
|
||||||
|
if get_settings().pr_update_changelog.get("skip_ci_on_push", True):
|
||||||
|
commit_message = "[skip ci] Update CHANGELOG.md"
|
||||||
|
else:
|
||||||
|
commit_message = "Update CHANGELOG.md"
|
||||||
self.git_provider.create_or_update_pr_file(
|
self.git_provider.create_or_update_pr_file(
|
||||||
file_path="CHANGELOG.md",
|
file_path="CHANGELOG.md",
|
||||||
branch=self.git_provider.get_pr_branch(),
|
branch=self.git_provider.get_pr_branch(),
|
||||||
contents=new_file_content,
|
contents=new_file_content,
|
||||||
message="[skip ci] Update CHANGELOG.md",
|
message=commit_message,
|
||||||
)
|
)
|
||||||
|
|
||||||
sleep(5) # wait for the file to be updated
|
sleep(5) # wait for the file to be updated
|
||||||
|
Reference in New Issue
Block a user