fix: fix maintenance branch regex
This commit is contained in:
		
							parent
							
								
									d10268a8fa
								
							
						
					
					
						commit
						a0229962ce
					
				| @ -13,7 +13,7 @@ try { | ||||
|   const result = await semanticRelease({ | ||||
|     // Core options | ||||
|     branches: [ | ||||
|       '+([1-9])?(.{+([1-9]),x}).x', | ||||
|       '+([0-9])?(.{+([0-9]),x}).x', | ||||
|       'master', | ||||
|       'next', | ||||
|       'next-major', | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| This recipe will walk you through a simple example that uses distribution channels to make releases available only to a subset of users, in order to collect feedbacks before distributing the release to all users. | ||||
| 
 | ||||
| This example uses the **semantic-release** default configuration: | ||||
| - [branches](../usage/configuration.md#branches): `['+([1-9])?(.{+([1-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [branches](../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [plugins](../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']` | ||||
| 
 | ||||
| ## Initial release | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| This recipe will walk you through a simple example that uses Git branches and distribution channels to publish fixes and features for old versions of a package. | ||||
| 
 | ||||
| This example uses the **semantic-release** default configuration: | ||||
| - [branches](../usage/configuration.md#branches): `['+([1-9])?(.{+([1-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [branches](../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [plugins](../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']` | ||||
| 
 | ||||
| ## Initial release | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| This recipe will walk you through a simple example that uses pre-releases to publish beta versions while working on a future major release and then make only one release on the default distribution. | ||||
| 
 | ||||
| This example uses the **semantic-release** default configuration: | ||||
| - [branches](../usage/configuration.md#branches): `['+([1-9])?(.{+([1-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [branches](../usage/configuration.md#branches): `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]` | ||||
| - [plugins](../usage/configuration.md#plugins): `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']` | ||||
| 
 | ||||
| ## Initial release | ||||
|  | ||||
| @ -70,7 +70,7 @@ List of modules or file paths containing a [shareable configuration](shareable-c | ||||
| ### branches | ||||
| 
 | ||||
| Type: `Array`, `String`, `Object`<br> | ||||
| Default: `['+([1-9])?(.{+([1-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]`<br> | ||||
| Default: `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next', 'next-major', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}]`<br> | ||||
| CLI arguments: `--branches` | ||||
| 
 | ||||
| The branches on which releases should happen. By default **semantic-release** will release: | ||||
|  | ||||
| @ -34,7 +34,7 @@ It can be defined as a [glob](https://github.com/micromatch/micromatch#matching- | ||||
| 
 | ||||
| If `name` doesn't match to any branch existing in the repository, the definition will be ignored. For example the default configuration includes the definition `next` and `next-major` which will become active only when the branches `next` and/or `next-major` are created in the repository. This allow to define your workflow once with all potential branches you might use and have the effective configuration evolving as you create new branches. | ||||
| 
 | ||||
| For example the configuration `['+([1-9])?(.{+([1-9]),x}).x', 'master', 'next']` will be expanded as: | ||||
| For example the configuration `['+([0-9])?(.{+([0-9]),x}).x', 'master', 'next']` will be expanded as: | ||||
| ```js | ||||
| { | ||||
|   branches: [ | ||||
|  | ||||
| @ -67,7 +67,7 @@ module.exports = async (context, opts) => { | ||||
|   // Set default options values if not defined yet
 | ||||
|   options = { | ||||
|     branches: [ | ||||
|       '+([1-9])?(.{+([1-9]),x}).x', | ||||
|       '+([0-9])?(.{+([0-9]),x}).x', | ||||
|       'master', | ||||
|       'next', | ||||
|       'next-major', | ||||
|  | ||||
| @ -6,9 +6,9 @@ test('Expand branches defined with globs', async t => { | ||||
|   const {cwd, repositoryUrl} = await gitRepo(true); | ||||
|   await gitCommits(['First'], {cwd}); | ||||
|   await gitPush(repositoryUrl, 'master', {cwd}); | ||||
|   await gitCheckout('1.1.x', true, {cwd}); | ||||
|   await gitCheckout('1.0.x', true, {cwd}); | ||||
|   await gitCommits(['Second'], {cwd}); | ||||
|   await gitPush(repositoryUrl, '1.1.x', {cwd}); | ||||
|   await gitPush(repositoryUrl, '1.0.x', {cwd}); | ||||
|   await gitCheckout('1.x.x', true, {cwd}); | ||||
|   await gitCommits(['Third'], {cwd}); | ||||
|   await gitPush(repositoryUrl, '1.x.x', {cwd}); | ||||
| @ -30,7 +30,7 @@ test('Expand branches defined with globs', async t => { | ||||
| 
 | ||||
|   const branches = [ | ||||
|     // Should match all maintenance type branches
 | ||||
|     {name: '+([1-9])?(.{+([1-9]),x}).x'}, | ||||
|     {name: '+([0-9])?(.{+([0-9]),x}).x'}, | ||||
|     {name: 'master', channel: 'latest'}, | ||||
|     {name: 'next'}, | ||||
|     {name: 'pre/{foo,bar}', channel: `\${name.replace(/^pre\\//g, '')}`, prerelease: true}, | ||||
| @ -42,7 +42,7 @@ test('Expand branches defined with globs', async t => { | ||||
|   ]; | ||||
| 
 | ||||
|   t.deepEqual(await expand({cwd}, branches), [ | ||||
|     {name: '1.1.x'}, | ||||
|     {name: '1.0.x'}, | ||||
|     {name: '1.x.x'}, | ||||
|     {name: '2.x'}, | ||||
|     {name: 'master', channel: 'latest'}, | ||||
|  | ||||
| @ -36,7 +36,7 @@ test('Default values, reading repositoryUrl from package.json', async t => { | ||||
| 
 | ||||
|   // Verify the default options are set
 | ||||
|   t.deepEqual(result.branches, [ | ||||
|     '+([1-9])?(.{+([1-9]),x}).x', | ||||
|     '+([0-9])?(.{+([0-9]),x}).x', | ||||
|     'master', | ||||
|     'next', | ||||
|     'next-major', | ||||
| @ -57,7 +57,7 @@ test('Default values, reading repositoryUrl from repo if not set in package.json | ||||
| 
 | ||||
|   // Verify the default options are set
 | ||||
|   t.deepEqual(result.branches, [ | ||||
|     '+([1-9])?(.{+([1-9]),x}).x', | ||||
|     '+([0-9])?(.{+([0-9]),x}).x', | ||||
|     'master', | ||||
|     'next', | ||||
|     'next-major', | ||||
| @ -79,7 +79,7 @@ test('Default values, reading repositoryUrl (http url) from package.json if not | ||||
| 
 | ||||
|   // Verify the default options are set
 | ||||
|   t.deepEqual(result.branches, [ | ||||
|     '+([1-9])?(.{+([1-9]),x}).x', | ||||
|     '+([0-9])?(.{+([0-9]),x}).x', | ||||
|     'master', | ||||
|     'next', | ||||
|     'next-major', | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user