From 80df7b21aea2dc4af2b7d260059af1bebfb5da89 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 29 Sep 2021 10:51:29 -0700 Subject: [PATCH] build: add the common commitlint action Uses the template in the edx organization. --- .github/workflows/commitlint.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000000..aedd0eaaef --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,37 @@ +# Run commitlint on the commit messasges in a pull request. + +name: Lint Commit Messages + +on: + - pull_request + +defaults: + run: + shell: bash + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Check for a local configuration file + id: check + run: | + if [[ ! -f commitlint.config.js ]]; then + echo "::set-output name=need::yes" + fi + + - name: Download configuration if needed + if: steps.check.outputs.need == 'yes' + uses: wei/wget@v1 + with: + args: -O commitlint.config.js https://raw.githubusercontent.com/edx/edx-lint/HEAD/edx_lint/files/commitlint.config.js + + - name: Run commitlint + uses: wagoid/commitlint-github-action@v4 + with: + helpURL: https://open-edx-proposals.readthedocs.io/en/latest/oep-0051-bp-conventional-commits.html