-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ory-specific GitHub action for conventional commits #94
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
49fbb57
Conventional commits config action
kevgo 4db22b7
.mocharc.json
kevgo 4d79733
CI
kevgo c6e7729
README
kevgo 0746653
README
kevgo 549353a
Validate JSON schema
kevgo bed8998
main.ts
kevgo 4944b01
error
kevgo fb99156
index.js
kevgo 67b1b43
action.ts main.test.ts main.ts
kevgo 347628c
index.js
kevgo f5559af
config.schema.json config.ts
kevgo 6a4dfa5
.eslintrc.js bool.test.ts main.test.ts main.ts
kevgo e4b9cc6
README
kevgo 0c66363
fix json schema
kevgo d76099a
action.yml index.js action.ts
kevgo 924c3d3
index.js bool.test.ts bool.ts
kevgo 5b68675
config.schema.json config.ts
kevgo dbed954
main.test.ts
kevgo ec690d9
main.test.ts
kevgo 7c8088a
main.ts
kevgo 21cc731
main.ts
kevgo 4cc3e8e
simplify
kevgo e804afe
string_list.test.ts
kevgo ab51b82
string_list.ts
kevgo ce1eea3
string_list.ts
kevgo 82c2c75
string_list.ts
kevgo 06bd555
index.js
kevgo ff4906a
README
kevgo f0ba6fa
spacing
kevgo 6346c54
index.js
kevgo 40d1bd2
index.js main.test.ts main.ts
kevgo 2d1ab83
index.js main.test.ts main.ts
kevgo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
push: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: cache-node | ||
uses: actions/cache@v3 | ||
with: | ||
path: conventional_commit_config/node_modules | ||
key: | ||
${{ runner.os }}-cococo-node-${{ | ||
hashFiles('conventional_commit_config/package-lock.json') }} | ||
- run: npm ci --legacy-peer-deps | ||
if: steps.cache-node.outputs.cache-hit != 'true' | ||
- run: cd conventional_commit_config && npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
env: { | ||
node: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"prettier", | ||
], | ||
rules: { | ||
"no-var": 0, | ||
"import/order": ["error", { alphabetize: { order: "asc" } }], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"spec": "src/**/*.test.ts", | ||
"ui": "tdd", | ||
"require": "ts-node/register" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Conventional Commits GitHub Action | ||
|
||
This Github Action is only used in | ||
https://github.com/ory/meta/blob/master/templates/repository/common/.github/workflows/conventional_commits.yml. | ||
It allows individual repositories to override the default scopes for | ||
conventional commits via a config file. | ||
|
||
This config file must be at `.github/conventional_commits.json` in your | ||
repository and have content that looks like this: | ||
|
||
```json | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/ory/ci/master/conventional_commit_config/dist/config.schema.json", | ||
"types": ["type1", "type2"], | ||
"addTypes": ["type3", "type4"], | ||
"scopes": ["scope1", "scope2"], | ||
"addScopes": ["scope3", "scope4"], | ||
"requireScope": true | ||
} | ||
``` | ||
|
||
You never need all options together. Set only the ones you need. | ||
|
||
| name | description | default | | ||
| -------------- | -------------------------------------------------- | ------- | | ||
| _types_ | overrides the default types | `[]` | | ||
| _addTypes_ | adds the given types to the set of default types | `[]` | | ||
| _scopes_ | overrides the default scopes | `[]` | | ||
| _addScopes_ | adds the given scopes to the set of default scopes | `[]` | | ||
| _requireScope_ | enforces a scope in pull requests titles | `false` | | ||
|
||
### Development | ||
|
||
GitHub Actions don't run `npm install` in production. This GitHub Actions | ||
therefore bundles external production dependencies into `dist/index.js`. To keep | ||
this file up to date, please remember to run `npm run build` before committing. | ||
Otherwise, your changes won't show up in production. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Conventional commits configuration | ||
description: determines the configuration for conventional commits | ||
|
||
inputs: | ||
config_path: | ||
description: path of the config file | ||
required: true | ||
default_types: | ||
description: the default types to use | ||
required: true | ||
default_scopes: | ||
description: the default scopes to use | ||
required: true | ||
default_require_scope: | ||
description: whether to require scopes by default | ||
required: true | ||
|
||
outputs: | ||
types: | ||
description: the types to use | ||
scopes: | ||
description: the scopes to use | ||
requireScope: | ||
description: whether to require scopes by default | ||
|
||
runs: | ||
using: node16 | ||
main: dist/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"additionalProperties": false, | ||
"description": "data format of the configuration file", | ||
"properties": { | ||
"$schema": { | ||
"description": "link to JSON schema", | ||
"type": "string" | ||
}, | ||
"addScopes": { | ||
"description": "add to the default scopes", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"addTypes": { | ||
"description": "add to the default types", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"requireScope": { | ||
"description": "whether to enforce a scope in pull request titles", | ||
"type": "boolean" | ||
}, | ||
"scopes": { | ||
"description": "override the default scopes", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"types": { | ||
"description": "override the default types", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!