-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Ory-specific GitHub action for conventional commits (#94)
- Loading branch information
Showing
22 changed files
with
16,024 additions
and
0 deletions.
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.