Skip to content

Commit 0085c56

Browse files
committed
test without fetch depth
1 parent 2a77c77 commit 0085c56

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ jobs:
4949
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v4
52-
- uses: coolapso/convcommitlint@main
52+
# with:
53+
# fetch-depth: 0
54+
- run: git fetch origin main:main
55+
- uses: coolapso/convcommitlint@action
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5358

action.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
current:
2020
description: 'Lints only current commit'
2121
required: false
22-
default: "false"
22+
default: "true"
2323
lint-all:
2424
description: 'Lints all commits in the history'
2525
required: false
@@ -42,17 +42,19 @@ runs:
4242
- name: "install conventional commit lint"
4343
shell: bash
4444
run: go install github.com/coolapso/convcommitlint@${{ inputs.version }}
45+
- name: "fetch base branch"
46+
shell: bash
47+
run: git fetch origin ${{ inputs.base-branch }}:${{ inputs.base-branch }}
48+
if: ${{ inputs.current == false }}
4549
- name: "Lint commits"
4650
shell: bash
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
CONVCOMLINT_BASE_BRANCH: ${{ inputs.base-branch }}
54+
CONVCOMLINT_COMMENT_ONLY: ${{ inputs.comment-only }}
55+
CONVCOMLINT_CREATE_REVIEW: ${{ inputs.create-review }}
56+
CONVCOMLINT_CURRENT: ${{ inputs.current }}
57+
CONVCOMLINT_LINT_ALL: ${{ inputs.lint-all }}
58+
CONVCOMLINT_PATH: ${{ inputs.path }}
4759
run: |
48-
export CONVCOMLINT_BASE_BRANCH=${{ inputs.base-branch }}
49-
export CONVCOMLINT_COMMENT_ONLY=${{ inputs.comment-only }}
50-
export CONVCOMLINT_CREATE_REVIEW=${{ inputs.create-review }}
51-
export CONVCOMLINT_CURRENT=${{ inputs.current }}
52-
export CONVCOMLINT_LINT_ALL=${{ inputs.lint-all }}
53-
export CONVCOMLINT_PATH=${{ inputs.path }}
5460
convcommitlint
55-
56-
57-
58-

0 commit comments

Comments
 (0)