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

[release helper] Fix extract for target date #26943

Merged
merged 1 commit into from
Oct 20, 2022
Merged
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
2 changes: 1 addition & 1 deletion scripts/release_helper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def auto_bot_advice(self):
def get_target_date(self):
body = self.get_issue_body()
try:
self.target_date = [line.split(':')[-1].strip() for line in body if 'Target release date' in line][0]
self.target_date = [re.compile(r"\d{4}-\d{1,2}-\d{1,2}").findall(l)[0] for l in body if 'Target release date' in l][0]
self.date_from_target = int((time.mktime(time.strptime(self.target_date, '%Y-%m-%d')) - time.time()) / 3600 / 24)
except Exception:
self.target_date = 'fail to get.'
Expand Down