diff --git a/.github/semantic.yml b/.github/semantic.yml deleted file mode 100755 index 16651452..00000000 --- a/.github/semantic.yml +++ /dev/null @@ -1,4 +0,0 @@ -titleOnly: false -commitsOnly: false -titleAndCommits: true -allowMergeCommits: true diff --git a/.github/workflows/dhis2-verify-commits.yml b/.github/workflows/dhis2-verify-commits.yml new file mode 100644 index 00000000..ae7831b5 --- /dev/null +++ b/.github/workflows/dhis2-verify-commits.yml @@ -0,0 +1,32 @@ +name: 'dhis2: verify (commits)' + +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + lint-pr-title: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: c-hive/gha-yarn-cache@v1 + - 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-commits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: c-hive/gha-yarn-cache@v1 + - 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 }} diff --git a/package.json b/package.json index aa676fef..7cb916ac 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "access": "public" }, "devDependencies": { + "@dhis2/cli-style": "^10.4.1", "@dhis2/cli-utils-docsite": "3.1.2", "tape": "5.3.2" } diff --git a/yarn.lock b/yarn.lock index 16a452f0..c107f789 100644 --- a/yarn.lock +++ b/yarn.lock @@ -378,6 +378,30 @@ handlebars "^4.7.3" isbinaryfile "^4.0.4" +"@dhis2/cli-style@^10.4.1": + version "10.4.1" + resolved "https://registry.yarnpkg.com/@dhis2/cli-style/-/cli-style-10.4.1.tgz#1186d79f4b4ef2802832a116562041ae50c596dc" + integrity sha512-4INZ2T67kZXkykUuNr9TqL0B88HYRYvtc2ctDV0IemK5bSNiwoQrgM6lqMIFHE5T48DEaFTQ3rvrd0nLjsW6Ng== + dependencies: + "@commitlint/cli" "^12.1.4" + "@commitlint/config-conventional" "^13.1.0" + "@dhis2/cli-helpers-engine" "^3.0.0" + "@ls-lint/ls-lint" "^1.10.0" + babel-eslint "^10.1.0" + eslint "^7.32.0" + eslint-config-prettier "^8.3.0" + eslint-plugin-import "^2.22.1" + eslint-plugin-react "^7.26.0" + fast-glob "^3.2.5" + find-up "^5.0.0" + fs-extra "^10.0.0" + husky "^7.0.2" + micromatch "^4.0.4" + perfy "^1.1.5" + prettier "^2.4.1" + semver "^7.3.5" + yargs "^16.2.0" + "@dhis2/cli-utils-docsite@3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@dhis2/cli-utils-docsite/-/cli-utils-docsite-3.1.2.tgz#ee67683b1611ae684cd6ab2f29a61b5fd1f2d31a"