Skip to content
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

fix(create_rc): Add git config to be able to push tag #27548

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/create_rc_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ env:
jobs:
create_rc_pr:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
Expand Down Expand Up @@ -43,16 +42,16 @@ jobs:
- name: Checkout release branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ env.RELEASE_BRANCH }}
ref: nschweitzer/add_git_config
fetch-depth: 0

- name: Check for changes since last RC
id: check_for_changes
run: |
echo "CHANGES=$(inv -e release.check-for-changes -r ${{ env.RELEASE_BRANCH }} ${{ env.WARNING }})" >> $GITHUB_OUTPUT
echo "DD_CHANGES=$(inv -e release.check-for-changes -r ${{ env.RELEASE_BRANCH }} ${{ env.WARNING }})" >> $GITHUB_ENV

- name: Create RC PR
if: ${{ steps.check_for_changes.outputs.CHANGES == 'true'}}
if: ${{ env.DD_CHANGES == '1' }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down
10 changes: 4 additions & 6 deletions tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,12 +916,12 @@ def check_for_changes(ctx, release_branch, warning_mode=False):
"""
next_version = next_rc_version(ctx, "7")
repo_data = generate_repo_data(warning_mode, next_version, release_branch)
changes = 'false'
changes = 0
for repo_name, repo in repo_data.items():
head_commit = get_last_commit(ctx, repo_name, repo['branch'])
last_tag_commit, last_tag_name = get_last_tag(ctx, repo_name, next_version.tag_pattern())
if last_tag_commit != "" and last_tag_commit != head_commit:
changes = 'true'
changes = 1
print(f"{repo_name} has new commits since {last_tag_name}", file=sys.stderr)
if warning_mode:
emails = release_manager(repo_name, repo['branch'])
Expand All @@ -930,13 +930,11 @@ def check_for_changes(ctx, release_branch, warning_mode=False):
if repo_name not in ["datadog-agent", "integrations-core"]:
with clone(ctx, repo_name, repo['branch'], options="--filter=blob:none --no-checkout"):
# We can add the new commit now to be used by release candidate creation
print(f"Creating new tag {next_version} on {repo_name}", file=sys.stderr)
ctx.run(f"git tag {next_version}")
ctx.run(f"git push origin tag {next_version}")
print(f"Should create new tag {next_version} on {repo_name}", file=sys.stderr)
# This repo has changes, the next check is not needed
continue
if repo_name != "datadog-agent" and last_tag_name != repo['previous_tag']:
changes = 'true'
changes = 1
print(
f"{repo_name} has a new tag {last_tag_name} since last release candidate (was {repo['previous_tag']})",
file=sys.stderr,
Expand Down
Loading