diff --git a/.github/workflows/create_rc_pr.yml b/.github/workflows/create_rc_pr.yml index c3fef65542567..0a87e11fb7f6e 100644 --- a/.github/workflows/create_rc_pr.yml +++ b/.github/workflows/create_rc_pr.yml @@ -48,10 +48,10 @@ jobs: - 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" diff --git a/tasks/release.py b/tasks/release.py index 6653bfce92ded..86e3059966956 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -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']) @@ -931,17 +931,10 @@ def check_for_changes(ctx, release_branch, warning_mode=False): 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"Should create new tag {next_version} on {repo_name}", file=sys.stderr) - ctx.run('git config --global user.name "github-actions[bot]"', hide=True) - ctx.run( - 'git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"', - hide=True, - ) - ctx.run(f"git tag {next_version}") - ctx.run(f"git push origin tag {next_version}") # 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,