From 341b9514fa3e97f2db929f372cc36f5a25fbc395 Mon Sep 17 00:00:00 2001 From: Wagner Santos Date: Sun, 5 Jan 2020 06:55:27 -0300 Subject: [PATCH] docs: update usage to explain how to use it with actions/checkout@v2 --- .github/workflows/ci.yml | 2 +- .github/workflows/commitlint.yml | 8 ++++++-- README.md | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a518b9..1d40e62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: '10.x' diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 2446a9c..145fc3e 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -7,7 +7,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml - run: echo -n '' > .dockerignore - uses: ./ @@ -16,7 +18,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml - run: echo -n '' > .dockerignore - uses: ./ diff --git a/README.md b/README.md index 138b46a..4e8fae2 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: wagoid/commitlint-github-action@v1 ``` -Alternatively, you can run on other event types such as `on: [push]`. In that case the action will lint the current commit instead of linting all commits from a pull request. +Alternatively, you can run on other event types such as `on: [push]`. In that case the action will lint the push event's commit(s) instead of linting commits from a pull request. You can also combine `push` and `pull_request` together in the same workflow. + +**Note**: It's necessary that you specify the `fetch-depth` argument to `actions/checkout@v2` step. By default they fetch only latest commit of the branch, but we need more commits since we validate a range of commit messages. ## Inputs