diff --git a/.github/workflows/dhis2-verify-commits.yml b/.github/workflows/dhis2-verify-commits.yml index a8600bb2..d2197571 100644 --- a/.github/workflows/dhis2-verify-commits.yml +++ b/.github/workflows/dhis2-verify-commits.yml @@ -5,34 +5,10 @@ on: types: ['opened', 'edited', 'reopened', 'synchronize'] jobs: - lint-pr-title: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - run: yarn install --frozen-lockfile - - id: commitlint - run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)") - - uses: JulienKode/pull-request-name-linter-action@v0.5.0 - with: - configuration-path: ${{ steps.commitlint.outputs.config_path }} - + lint: + uses: dhis2/workflows-platform/.github/workflows/lint.yml@v1 + with: + node-version: 16 + cache: 'yarn' lint-commits: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'yarn' - - run: yarn install --frozen-lockfile - - id: commitlint - run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)") - - uses: wagoid/commitlint-github-action@v4 - with: - configFile: ${{ steps.commitlint.outputs.config_path }} + uses: dhis2/workflows-platform/.github/workflows/lint-commits.yml@v1 diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 00000000..67ce25e6 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,13 @@ +name: lint-pr-title + +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + lint-pr-title: + uses: dhis2/workflows-platform/.github/workflows/lint-pr-title.yml@v1 \ No newline at end of file diff --git a/package.json b/package.json index 4135cb21..9ec962a2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "test:server": "yarn workspace server test", "test:client": "yarn workspace client test", "clone": "yarn workspace tools clone", + "lint": "d2-style check", + "lint:staged": "d2-style check --staged", "format": "yarn format:js && yarn format:text", "format:staged": "yarn format:js --staged && yarn format:text --staged", "format:js": "d2-style apply js",