Skip to content

Commit

Permalink
Merge pull request #1411 from mightyiam/no-use-commitlint-github-action
Browse files Browse the repository at this point in the history
build(commitlint): don't use a github action
  • Loading branch information
rostislav-simonik committed Jan 27, 2024
2 parents 80e4ce7 + 8b49ee7 commit d1c59f8
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ on:
- master

jobs:
commitlint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: latest
- run: npm ci
# Hiding tsconfig.json to workaround
# https://github.com/conventional-changelog/commitlint/issues/3256
- run: mv tsconfig.json tsconfig.json.nope
- name: commitlint
run: |
npx commitlint \
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \
--to ${{ github.event.pull_request.head.sha }} \
--verbose
- run: mv tsconfig.json.nope tsconfig.json
publish:
needs: ci
if: github.ref == 'refs/heads/master'
Expand All @@ -31,30 +52,23 @@ jobs:
# If we were to use those checks as required checks, we would have to occasionally bump them.
# This job allows us to have a single check that we don't have to bump.
ci:
needs: ci-matrix
needs: [commitlint, test]
runs-on: ubuntu-latest
steps:
- run: exit 0
ci-matrix:
test:
needs: get-supported-node-versions
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ${{ fromJson(needs.get-supported-node-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for commit linting
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm --global install npm@latest
- run: npm ci
# Hiding tsconfig.json to workaround
# https://github.com/conventional-changelog/commitlint/issues/3256
- run: mv tsconfig.json tsconfig.json.nope
- uses: wagoid/commitlint-github-action@v5
- run: mv tsconfig.json.nope tsconfig.json
- run: npm test
get-supported-node-versions:
runs-on: ubuntu-latest
Expand Down

0 comments on commit d1c59f8

Please sign in to comment.