From c145823103aa6a03930ab8cff12c92d2fd151a13 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 19 Aug 2022 18:19:55 +0100 Subject: [PATCH 1/3] Make "Update release branch" workflow fail if `npm version` fails --- .github/update-release-branch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index c5f5c1dbbb..27d0fa08b2 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -88,6 +88,7 @@ def open_pr( body.append('') body.append('Please review the following:') if len(conflicted_files) > 0: + body.append('- The package.json file contains the correct version.') body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' + 'in the following files:') body.extend([f' - [ ] `{file}`' for file in conflicted_files]) @@ -296,15 +297,15 @@ def main(): # Migrate the package version number from a v2 version number to a v1 version number print(f'Setting version number to {version}') - subprocess.run(['npm', 'version', version, '--no-git-tag-version']) + subprocess.check_output(['npm', 'version', version, '--no-git-tag-version']) run_git('add', 'package.json', 'package-lock.json') # Migrate the changelog notes from v2 version numbers to v1 version numbers print('Migrating changelog notes from v2 to v1') - subprocess.run(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md']) + subprocess.check_output(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md']) # Remove changelog notes from v2 that don't apply to v1 - subprocess.run(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md']) + subprocess.check_output(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md']) # Amend the commit generated by `npm version` to update the CHANGELOG run_git('add', 'CHANGELOG.md') From 2927215a2b6cf087c63916a1739a3678934fb92e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 19 Aug 2022 18:37:55 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Edoardo Pirovano <6748066+edoardopirovano@users.noreply.github.com> --- .github/update-release-branch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index 27d0fa08b2..b34cad1dfb 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -88,7 +88,7 @@ def open_pr( body.append('') body.append('Please review the following:') if len(conflicted_files) > 0: - body.append('- The package.json file contains the correct version.') + body.append('- [ ] The `package.json` file contains the correct version.') body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' + 'in the following files:') body.extend([f' - [ ] `{file}`' for file in conflicted_files]) From a07454207a05ad34b2ef2b7750b99e0023782f6e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 22 Aug 2022 09:52:06 +0100 Subject: [PATCH 3/3] Tweak whitespace in checklist for consistency Co-authored-by: Andrew Eisenberg --- .github/update-release-branch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index b34cad1dfb..7697e59430 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -88,7 +88,7 @@ def open_pr( body.append('') body.append('Please review the following:') if len(conflicted_files) > 0: - body.append('- [ ] The `package.json` file contains the correct version.') + body.append(' - [ ] The `package.json` file contains the correct version.') body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' + 'in the following files:') body.extend([f' - [ ] `{file}`' for file in conflicted_files])