From 785693bbae9208dc9e55435cd27ee7a6941421ec Mon Sep 17 00:00:00 2001 From: ismay <7355199+ismay@users.noreply.github.com> Date: Wed, 20 Apr 2022 16:56:05 +0200 Subject: [PATCH 1/4] ci: add pr title check workflow --- ci/dhis2-verify-pr-title.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ci/dhis2-verify-pr-title.yml diff --git a/ci/dhis2-verify-pr-title.yml b/ci/dhis2-verify-pr-title.yml new file mode 100644 index 0000000..43347d7 --- /dev/null +++ b/ci/dhis2-verify-pr-title.yml @@ -0,0 +1,13 @@ +name: 'dhis2: verify (pr title)' + +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: yarn install @commitlint/config-conventional + - uses: JulienKode/pull-request-name-linter-action@v0.5.0 From 15152c1114af16408db13de1ded515cb6d46f8a5 Mon Sep 17 00:00:00 2001 From: ismay <7355199+ismay@users.noreply.github.com> Date: Wed, 20 Apr 2022 17:46:56 +0200 Subject: [PATCH 2/4] ci: add commit check job step --- ci/dhis2-verify-app.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/dhis2-verify-app.yml b/ci/dhis2-verify-app.yml index 52dd542..d0a3dd3 100644 --- a/ci/dhis2-verify-app.yml +++ b/ci/dhis2-verify-app.yml @@ -49,6 +49,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-node@v1 with: node-version: 12.x @@ -63,6 +65,9 @@ jobs: - name: Lint run: yarn d2-style check + - uses: wagoid/commitlint-github-action@v4 + with: + configFile: commitlint.config.js test: runs-on: ubuntu-latest From 292bbb22112e9a7acde96903085ab4b5c9b974dd Mon Sep 17 00:00:00 2001 From: ismay <7355199+ismay@users.noreply.github.com> Date: Thu, 21 Apr 2022 14:44:34 +0200 Subject: [PATCH 3/4] ci: use cli-style commitlint config --- ci/dhis2-verify-app.yml | 15 ++++++++++++--- ci/dhis2-verify-pr-title.yml | 11 ++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ci/dhis2-verify-app.yml b/ci/dhis2-verify-app.yml index d0a3dd3..657e8df 100644 --- a/ci/dhis2-verify-app.yml +++ b/ci/dhis2-verify-app.yml @@ -49,8 +49,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - fetch-depth: 0 - uses: actions/setup-node@v1 with: node-version: 12.x @@ -65,9 +63,20 @@ jobs: - name: Lint run: yarn d2-style check + + commitlint: + 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: commitlint.config.js + configFile: ${{ steps.commitlint.outputs.config_path }} test: runs-on: ubuntu-latest diff --git a/ci/dhis2-verify-pr-title.yml b/ci/dhis2-verify-pr-title.yml index 43347d7..982a3c1 100644 --- a/ci/dhis2-verify-pr-title.yml +++ b/ci/dhis2-verify-pr-title.yml @@ -1,13 +1,18 @@ -name: 'dhis2: verify (pr title)' +name: 'dhis2: check pr title' on: pull_request: types: ['opened', 'edited', 'reopened', 'synchronize'] jobs: - verify: + commitlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: yarn install @commitlint/config-conventional + - 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 }} From 7204eb51d5d8cb9a6140350d5e07a46afa69377a Mon Sep 17 00:00:00 2001 From: ismay <7355199+ismay@users.noreply.github.com> Date: Thu, 21 Apr 2022 14:54:19 +0200 Subject: [PATCH 4/4] ci: add commit check to all workflows --- ci/dhis2-verify-lib.yml | 14 ++++++++++++++ ci/dhis2-verify-node.yml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ci/dhis2-verify-lib.yml b/ci/dhis2-verify-lib.yml index b623a54..91ab7ce 100644 --- a/ci/dhis2-verify-lib.yml +++ b/ci/dhis2-verify-lib.yml @@ -55,6 +55,20 @@ jobs: - name: Lint run: yarn d2-style check + commitlint: + 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 }} + test: runs-on: ubuntu-latest needs: [build] diff --git a/ci/dhis2-verify-node.yml b/ci/dhis2-verify-node.yml index abc99d5..d73f277 100644 --- a/ci/dhis2-verify-node.yml +++ b/ci/dhis2-verify-node.yml @@ -34,6 +34,20 @@ jobs: - name: Lint run: yarn d2-style check + commitlint: + 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 }} + test: runs-on: ubuntu-latest steps: