5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 08:06:54 +00:00

docs: update usage to explain how to use it with actions/checkout@v2

This commit is contained in:
Wagner Santos 2020-01-05 06:55:27 -03:00
parent c8ff3dcea8
commit 341b9514fa
3 changed files with 13 additions and 5 deletions

View file

@ -6,7 +6,7 @@ jobs:
name: Test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '10.x'

View file

@ -7,7 +7,9 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml - run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml
- run: echo -n '' > .dockerignore - run: echo -n '' > .dockerignore
- uses: ./ - uses: ./
@ -16,7 +18,9 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml - run: sed -i -E "s/([']docker:.+)/Dockerfile/" ./action.yml
- run: echo -n '' > .dockerignore - run: echo -n '' > .dockerignore
- uses: ./ - uses: ./

View file

@ -16,11 +16,15 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1 - 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 ## Inputs