Skip to content

Commit f0a1a35

Browse files
authored
Merge pull request #1197 from github/henrymercer/fix-release-when-package-conflicts
Make "Update release branch" workflow fail if `npm version` fails
2 parents 53a7a27 + a074542 commit f0a1a35

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/update-release-branch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def open_pr(
8888
body.append('')
8989
body.append('Please review the following:')
9090
if len(conflicted_files) > 0:
91+
body.append(' - [ ] The `package.json` file contains the correct version.')
9192
body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' +
9293
'in the following files:')
9394
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
@@ -296,15 +297,15 @@ def main():
296297

297298
# Migrate the package version number from a v2 version number to a v1 version number
298299
print(f'Setting version number to {version}')
299-
subprocess.run(['npm', 'version', version, '--no-git-tag-version'])
300+
subprocess.check_output(['npm', 'version', version, '--no-git-tag-version'])
300301
run_git('add', 'package.json', 'package-lock.json')
301302

302303
# Migrate the changelog notes from v2 version numbers to v1 version numbers
303304
print('Migrating changelog notes from v2 to v1')
304-
subprocess.run(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md'])
305+
subprocess.check_output(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md'])
305306

306307
# Remove changelog notes from v2 that don't apply to v1
307-
subprocess.run(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md'])
308+
subprocess.check_output(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md'])
308309

309310
# Amend the commit generated by `npm version` to update the CHANGELOG
310311
run_git('add', 'CHANGELOG.md')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy