Skip to content

Commit

Permalink
feat: (DSO-2078) Implement conventional commits
Browse files Browse the repository at this point in the history
  • Loading branch information
javiercm1410 committed May 24, 2024
1 parent 9465bdb commit e78cfbd
Show file tree
Hide file tree
Showing 8 changed files with 6,557 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ✨ Lint

on:
pull_request:
branches:
- main

concurrency:
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: true

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current code ref
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🟢 Configure Node.js on runner
uses: actions/setup-node@v4
with:
node-version-file: '.tool-versions'

- name: 📦 Install package dependencies using lockfile
run: npm ci

# Check all commits pushed to this PR
- name: 👁️‍🗨️ Validate PR commits with commitlint
run: >-
npx commitlint
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
--to ${{ github.event.pull_request.head.sha }}
--verbose
- name: 🔎 Validate PR title with commitlint
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🚀 Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current pull-request revision code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 💼 Configure Git user
run: |
git config user.name "gbh-devops-bot"
git config user.email "[email protected]"
- name: 📦 Install package dependencies using lockfile
run: npm ci

- name: 🚀 Run new version for production
run: npx release-it --ci
env:
GITHUB_TOKEN: ${{ secrets.DEVOPS_USER_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
30 changes: 30 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"github": {
"release": true,
"releaseName": "v${version}"
},
"git": {
"commitMessage": "chore: release v${version}",
"requireBranch": "main",
"tagMatch": "v[0-9]*\\.[0-9]*\\.[0-9]*",
"tagName": "v${version}",
"getLatestTagFromAllRefs": true,
"tagExclude": "*[-]*",
"push": true,
"requireCommits": true,
"release": true,
"pushArgs": ["--no-verify", "--follow-tags"],
"commitArgs": ["--no-verify"]
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "conventionalcommits",
"preset": {
"name": "conventionalcommits"
}
},
"infile": "CHANGELOG.md"
}
}
}
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
task 3.35.1
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
Loading

0 comments on commit e78cfbd

Please sign in to comment.