I would like to post a comment on the initial pull request after it's been merged in the SoT repo.
github_api_obj = git.github_api("politician/test2", checker = None)
core.workflow(
name = "pr",
origin = git.github_pr_origin(
url = "git@github.com:politician/test2.git",
branch = "main",
),
destination = git.github_pr_destination(
url = "git@github.com:politician/test.git",
destination_ref = "main",
integrates = [],
),
origin_files = glob(["**"]),
authoring = authoring.pass_thru(default = "Github Actions <actions@github.com>"),
mode = "CHANGE_REQUEST",
set_rev_id = False,
transformations = [
metadata.save_author("ORIGINAL_AUTHOR"),
metadata.expose_label("GITHUB_PR_NUMBER", new_name = "Closes", separator = " politician/test2#"),
],
)
core.workflow(
name = "push",
origin = git.origin(
url = "file:///usr/src/app",
ref = "main",
),
destination = git.github_destination(
url = "git@github.com:politician/test2.git",
push = "main",
),
origin_files = glob(["**"]),
authoring = authoring.pass_thru(default = "Github Actions <actions@github.com>"),
mode = "ITERATIVE",
transformations = [
metadata.restore_author("ORIGINAL_AUTHOR", search_all_changes = True),
metadata.expose_label("COPYBARA_INTEGRATE_REVIEW"),
],
after_workflow = [
github_api_obj.post_issue_comment("GITHUB_PR_NUMBER", "This pull request has been merged from another repository."),
],
)
Could you please tell me where and how I am supposed to use it to achieve the desired behaviour? Also, I don't need it to run it if there is no label GITHUB_PR_NUMBER defined
I would like to post a comment on the initial pull request after it's been merged in the SoT repo.
My
copy.bara.sky:Then I get the error
Error: 'endpoint_provider' value has no field or method 'post_issue_comment'when running thepushworkflow.Could you please tell me where and how I am supposed to use it to achieve the desired behaviour? Also, I don't need it to run it if there is no label
GITHUB_PR_NUMBERdefined