Skip to content

Commit

Permalink
fix(refactor): Replace CI workflow with commitlint
Browse files Browse the repository at this point in the history
replacing the lab42 image with https://commitlint.js.org/ since the lab42 image was taken down, breaking our GH action

docs: Add Architecture Decision Records documentation
  • Loading branch information
tfhartmann committed Nov 2, 2024
1 parent 39ff407 commit f17258e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/conventional-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,51 @@ jobs:
working-directory: ${{ inputs.working_directory }}
runs-on: ${{ inputs.jobs_run_on }}
steps:
- name: Validate PR title
uses: 'lab42/[email protected]'
# - name: Validate PR title
# uses: 'lab42/[email protected]'
# with:
# description_regexp: '(.*)'
- uses: actions/checkout@v3
with:
description_regexp: '(.*)'
fetch-depth: 0
- name: Install required dependencies
run: |
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Install commitlint
run: |
# npm install conventional-changelog-conventionalcommits
# npm install commitlint@latest
npm install --save-dev @commitlint/{cli,config-conventional}
# I hate myself for the below
cat <<- EOF > commitlint.config.ts
import type {UserConfig} from '@commitlint/types';
import {RuleConfigSeverity} from '@commitlint/types';
const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [0, 'never', []],
'body-max-line-length': [0, 'always', 100],
},
};
export default Configuration;
EOF
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
# yamllint disable-line rule:line-length
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
timeout-minutes: ${{ inputs.timeout_minutes }}
1 change: 1 addition & 0 deletions docs/adr/.adr-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.
19 changes: 19 additions & 0 deletions docs/adr/0001-record-architecture-decisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 1. Record architecture decisions

Date: 2024-11-02

## Status

Accepted

## Context

We need to record the architectural decisions made on this project.

## Decision

We will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).

## Consequences

See Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ site_name: 'GitHub Actions for Broad Institute Shared Workflows'

nav:
- Home: README.md
- ADRs: adr/README.md

plugins:
- techdocs-core

0 comments on commit f17258e

Please sign in to comment.