Merge pull request #1197 from github/henrymercer/fix-release-when-package-conflicts
Make "Update release branch" workflow fail if `npm version` fails
This commit is contained in:
commit
f0a1a35a9f
1 changed files with 4 additions and 3 deletions
7
.github/update-release-branch.py
vendored
7
.github/update-release-branch.py
vendored
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue