Skip to content

Commit 1f52133

Browse files
committed
feat: initial orb release [semver:major]
1 parent 71d8c6b commit 1f52133

24 files changed

+314
-396
lines changed

.circleci/config.yml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ orbs:
44
# Replace this with your own!
55
commitlint: conventional-changelog/commitlint@<<pipeline.parameters.dev-orb-version>>
66
orb-tools: circleci/[email protected]
7-
bats: circleci/[email protected]
87
shellcheck: circleci/[email protected]
8+
bats: circleci/[email protected]
9+
node: circleci/[email protected]
910

1011
# Pipeline Parameters
1112
## These parameters are used internally by orb-tools. Skip to the Jobs section.
@@ -22,18 +23,6 @@ parameters:
2223
type: string
2324
default: "dev:alpha"
2425

25-
jobs:
26-
# Define one or more jobs which will utilize your orb's commands and parameters to validate your changes.
27-
integration-test-1:
28-
docker:
29-
- image: cimg/base:stable
30-
steps:
31-
- checkout
32-
# "greet" is a sample command packaged with this orb config.
33-
# This sample integration test will run as long as the greet command exists. Once you remove the greet command you should remove this line.
34-
# Push new changes first, before adding new tests to your config.
35-
- commitlint/greet
36-
3726
workflows:
3827
# Prior to producing a development orb (which requires credentials) basic validation, linting, and even unit testing can be performed.
3928
# This workflow will run on every commit
@@ -45,51 +34,47 @@ workflows:
4534
- shellcheck/check:
4635
dir: ./src/scripts
4736
exclude: SC2148
48-
# optional: Run BATS tests against your scripts
4937
- bats/run:
38+
exec_environment: node/default
5039
path: ./src/tests
40+
pre-steps:
41+
- run:
42+
name: Git Config
43+
command: |
44+
mkdir -p ~/.config/yarn
45+
sudo chown -R circleci ~/.config/
46+
sudo chgrp -R circleci ~/.config/
47+
git config --global user.email "[email protected]"
48+
git config --global user.name "CPE Team"
5149
# Publish development version(s) of the orb.
5250
- orb-tools/publish-dev:
5351
orb-name: conventional-changelog/commitlint
5452
context: orb-publishing # A restricted context containing your private publishing credentials. Will only execute if approved by an authorized user.
5553
requires:
5654
- orb-tools/lint
5755
- orb-tools/pack
58-
- bats/run
5956
- shellcheck/check
57+
- bats/run
6058
# Trigger an integration workflow to test the
6159
# dev:${CIRCLE_SHA1:0:7} version of your orb
6260
- orb-tools/trigger-integration-tests-workflow:
6361
name: trigger-integration-dev
6462
context: orb-publishing
6563
requires:
6664
- orb-tools/publish-dev
67-
68-
# This `integration-test_deploy` workflow will only run
69-
# when the run-integration-tests pipeline parameter is set to true.
70-
# It is meant to be triggered by the "trigger-integration-tests-workflow"
71-
# job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}.
7265
integration-test_deploy:
7366
when: << pipeline.parameters.run-integration-tests >>
7467
jobs:
75-
# Run any integration tests defined within the `jobs` key.
76-
- integration-test-1
77-
# Publish a semver version of the orb. relies on
78-
# the commit subject containing the text "[semver:patch|minor|major|skip]"
79-
# as that will determine whether a patch, minor or major
80-
# version will be published or if publishing should
81-
# be skipped.
82-
# e.g. [semver:patch] will cause a patch version to be published.
68+
- commitlint/lint
8369
- orb-tools/dev-promote-prod-from-commit-subject:
8470
orb-name: conventional-changelog/commitlint
8571
context: orb-publishing
8672
add-pr-comment: false
8773
fail-if-semver-not-indicated: true
8874
publish-version-tag: false
8975
requires:
90-
- integration-test-1
76+
- commitlint/lint
9177
filters:
9278
branches:
9379
only:
94-
- master
9580
- main

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# orb.yml is "packed" from source, and not published directly from the repository.
2-
orb.yml
2+
orb.yml
3+
node_modules/

CHANGELOG.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
1-
# Orb Project Template
1+
# commitlint orb
22

33
[![CircleCI Build Status](https://circleci.com/gh/conventional-changelog/commitlint-orb.svg?style=shield "CircleCI Build Status")](https://circleci.com/gh/conventional-changelog/commitlint-orb) [![CircleCI Orb Version](https://badges.circleci.com/orbs/conventional-changelog/commitlint.svg)](https://circleci.com/orbs/registry/orb/conventional-changelog/commitlint) [![GitHub License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/conventional-changelog/commitlint-orb/master/LICENSE) [![CircleCI Community](https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg)](https://discuss.circleci.com/c/ecosystem/orbs)
44

55

66

7-
A starter template for orb projects. Build, test, and publish orbs automatically on CircleCI with [Orb-Tools](https://circleci.com/orbs/registry/orb/circleci/orb-tools).
7+
Lint your commit messages in a CircleCI job.
88

9-
Additional READMEs are available in each directory.
9+
Add this orb's `commitlint/lint` job to your existing CircleCI workflow to utilize [commitlint](https://github.com/conventional-changelog/commitlint) for validating commit messages against the [conventional commit format](https://conventionalcommits.org/).
1010

11+
## Example
12+
13+
This example shows importing the `commitlint` orb into a basic CircleCI 2.1 config file, and adding the `commitlint/lint` job to a workflow. This configuration will lint every commit pushed to the repository.
14+
15+
```yaml
16+
version: 2.1
17+
orbs:
18+
# Use the latest version of the orb.
19+
# See the Orb Registry, or GitHub Releases
20+
commitlint: conventional-changelog/commitlint@<latest version>
21+
workflows:
22+
my-workflow:
23+
jobs:
24+
- commitlint/lint
25+
```
26+
27+
CircleCI will report back the status of the `commitlint/lint` job and block a Pull Request from being merged if the job fails.
28+
29+
## Run the commitlint orb locally
30+
Want to test out the commitlint orb in your CI pipeline before pushing your changes? Use the CircleCI CLI to run any job defined in your `.circleci/config.yml` locally, including jobs from orbs.
31+
32+
Assuming your config file looks similar to the example above, and you have the [CircleCI CLI](https://circleci.com/docs/2.0/local-cli/) installed, you can run this orb for the current project locally with the following command.
33+
34+
```shell
35+
circleci local execute --job commitlint/lint
36+
```
1137

1238

1339
## Resources

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']}

src/@orb.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
version: 2.1
22

33
description: >
4-
Sample orb description
5-
# What will your orb allow users to accomplish?
6-
# Descriptions should be short, simple, and informative.
4+
commitlint helps your team adhere to a standard commit convention.
5+
Add commit message linting to your CI process to prevent non-standard commit messages from being merged, and provide contrinbutors with details for resolving their PR.
76
8-
# This information will be displayed in the orb registry and is not mandatory.
97
display:
10-
home_url: "https://www.website.com/docs"
11-
source_url: "https://www.github.com/EXAMPLE_ORG/EXAMPLE_PROJECT"
8+
home_url: "https://commitlint.js.org/"
9+
source_url: "https://github.com/conventional-changelog/commitlint"
1210

13-
# If your orb requires other orbs, you can import them like this. Otherwise remove the "orbs" stanza.
14-
# orbs:
15-
# hello: circleci/[email protected]

src/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/commands/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/commands/greet.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/examples/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)