Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: npm config list && npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN_RELEASE: ${{ secrets.PAT_TOKEN }}
GA_USERNAME: ${{ secrets.PAT_USERNAME }}
GA_TOKEN: ${{ secrets.PAT_TOKEN }}

Expand Down
17 changes: 0 additions & 17 deletions .releaserc

This file was deleted.

30 changes: 30 additions & 0 deletions commit-format.cjs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing isn't strictly necessary but just a nice to have to be consistent across BC repos. Let me know if we want to keep this scoped to just the GH_TOKEN issue.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Shared commit message parser used by commitlint (commitlint.config.cjs) and
// semantic-release (release.config.cjs). Accepts both the BigCommerce ticket-first
// format enforced by @bigcommerce/validate-commits and the legacy conventional format:
// TRAC-123: type(scope) - subject
// type(scope): TRAC-123 subject
const parserOpts = {
headerPattern: /^(?:[A-Z0-9]{2,}-\d+: )?(\w+)(?:\(([^)]*)\))?!?(?::| -) (.+)$/,
breakingHeaderPattern: /^(?:[A-Z0-9]{2,}-\d+: )?(\w+)(?:\(([^)]*)\))?!(?::| -) (.+)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
};

// Union of @commitlint/config-conventional and @bigcommerce/validate-commits types
const types = [
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'license',
'meta',
'perf',
'ref',
'refactor',
'revert',
'style',
'test',
];

module.exports = { parserOpts, types };
4 changes: 4 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const { parserOpts, types } = require('./commit-format.cjs');

module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: { parserOpts },
rules: {
'subject-case': [0, 'always', 'sentence-case'],
'type-enum': [2, 'always', types],
},
};
21 changes: 21 additions & 0 deletions release.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { parserOpts } = require('./commit-format.cjs');

module.exports = {
branches: ['master'],
// eslint-disable-next-line no-template-curly-in-string
tagFormat: '${version}',
plugins: [
['@semantic-release/commit-analyzer', { parserOpts }],
['@semantic-release/release-notes-generator', { parserOpts }],
'@semantic-release/changelog',
'@semantic-release/github',
'@semantic-release/npm',
[
'semantic-release-github-pullrequest-fixed',
{
assets: ['CHANGELOG.md', 'package.json'],
baseRef: 'master',
},
],
],
};
Loading