|
41 | 41 | )
|
42 | 42 | from tasks.libs.common.gomodules import get_default_modules
|
43 | 43 | from tasks.libs.common.user_interactions import yes_no_question
|
| 44 | +from tasks.libs.common.utils import set_gitconfig_in_ci |
44 | 45 | from tasks.libs.common.worktree import agent_context
|
45 | 46 | from tasks.libs.pipeline.notifications import (
|
46 | 47 | DEFAULT_JIRA_PROJECT,
|
@@ -206,6 +207,7 @@ def tag_modules(
|
206 | 207 |
|
207 | 208 | if push:
|
208 | 209 | tags_list = ' '.join(tags)
|
| 210 | + set_gitconfig_in_ci(ctx) |
209 | 211 | for idx in range(0, len(tags), TAG_BATCH_SIZE):
|
210 | 212 | batch_tags = tags[idx : idx + TAG_BATCH_SIZE]
|
211 | 213 | ctx.run(f"git push origin {' '.join(batch_tags)}{force_option}")
|
@@ -250,6 +252,7 @@ def tag_version(
|
250 | 252 | with agent_context(ctx, release_branch, skip_checkout=release_branch is None):
|
251 | 253 | tags = __tag_single_module(ctx, get_default_modules()["."], agent_version, commit, force_option, devel)
|
252 | 254 |
|
| 255 | + set_gitconfig_in_ci(ctx) |
253 | 256 | # create or update the qualification tag using the force option (points tag to next RC)
|
254 | 257 | if is_agent6(ctx) and (start_qual or is_qualification(ctx, "6.53.x")):
|
255 | 258 | if FINAL_VERSION_RE.match(agent_version):
|
@@ -323,6 +326,7 @@ def finish(ctx, release_branch, upstream="origin"):
|
323 | 326 |
|
324 | 327 | commit_message = f"'Final updates for release.json and Go modules for {new_version} release'"
|
325 | 328 |
|
| 329 | + set_gitconfig_in_ci(ctx) |
326 | 330 | ok = try_git_command(ctx, f"git commit -m {commit_message}")
|
327 | 331 | if not ok:
|
328 | 332 | raise Exit(
|
@@ -394,12 +398,6 @@ def create_rc(ctx, release_branch, patch_version=False, upstream="origin", slack
|
394 | 398 |
|
395 | 399 | with agent_context(ctx, release_branch):
|
396 | 400 | github = GithubAPI(repository=GITHUB_REPO_NAME)
|
397 |
| - github_action = os.environ.get("GITHUB_ACTIONS") |
398 |
| - |
399 |
| - if github_action: |
400 |
| - set_git_config('user.name', 'github-actions[bot]') |
401 |
| - set_git_config('user.email', 'github-actions[bot]@users.noreply.github.com') |
402 |
| - upstream = f"https://x-access-token:{os.environ.get('GITHUB_TOKEN')}@github.com/{GITHUB_REPO_NAME}.git" |
403 | 401 |
|
404 | 402 | # Get the version of the highest major: useful for some logging & to get
|
405 | 403 | # the version to use for Go submodules updates
|
@@ -454,10 +452,10 @@ def create_rc(ctx, release_branch, patch_version=False, upstream="origin", slack
|
454 | 452 | ctx.run("git add release.json")
|
455 | 453 | ctx.run("git ls-files . | grep 'go.mod$' | xargs git add")
|
456 | 454 |
|
| 455 | + set_gitconfig_in_ci(ctx) |
457 | 456 | ok = try_git_command(
|
458 | 457 | ctx,
|
459 | 458 | f"git commit --no-verify -m 'Update release.json and Go modules for {new_highest_version}'",
|
460 |
| - github_action, |
461 | 459 | )
|
462 | 460 | if not ok:
|
463 | 461 | raise Exit(
|
@@ -673,6 +671,7 @@ def _main():
|
673 | 671 | # Step 2 - Push newly created release branch to the remote repository
|
674 | 672 |
|
675 | 673 | print(color_message("Pushing new branch to the upstream repository", "bold"))
|
| 674 | + set_gitconfig_in_ci(ctx) |
676 | 675 | res = ctx.run(f"git push --set-upstream {upstream} {release_branch}", warn=True)
|
677 | 676 | if res.exited is None or res.exited > 0:
|
678 | 677 | raise Exit(
|
@@ -863,6 +862,7 @@ def cleanup(ctx, release_branch):
|
863 | 862 | ctx.run("git add release.json")
|
864 | 863 |
|
865 | 864 | commit_message = f"Update last_stable to {version}"
|
| 865 | + set_gitconfig_in_ci(ctx) |
866 | 866 | ok = try_git_command(ctx, f"git commit -m '{commit_message}'")
|
867 | 867 | if not ok:
|
868 | 868 | raise Exit(
|
@@ -1175,6 +1175,7 @@ def check_for_changes(ctx, release_branch, warning_mode=False):
|
1175 | 1175 | with clone(ctx, repo_name, repo['branch'], options="--filter=blob:none --no-checkout"):
|
1176 | 1176 | # We can add the new commit now to be used by release candidate creation
|
1177 | 1177 | print(f"Creating new tag {next_version} on {repo_name}", file=sys.stderr)
|
| 1178 | + set_gitconfig_in_ci(ctx) |
1178 | 1179 | ctx.run(f"git tag {next_version}")
|
1179 | 1180 | ctx.run(f"git push origin tag {next_version}")
|
1180 | 1181 | # This repo has changes, the next check is not needed
|
|
0 commit comments