Skip to content

Commit c97e783

Browse files
committed
ci: checkout correctly from start and test after
1 parent 603081a commit c97e783

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/test.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: ${{ inputs.fetch-depth }}
21+
ref: ${{ github.head_ref }}
22+
23+
- name: 'get base branch last commit'
24+
run: git fetch origin ${{ inputs.base-branch }}:${{ inputs.base-branch }} --depth 1
25+
shell: bash
26+
if: ${{ github.ref_name != inputs.base-branch }}
1927

2028
- name: Setup Go
2129
uses: actions/setup-go@v5
@@ -45,16 +53,6 @@ jobs:
4553
- name: test build
4654
run: go build -o convcommitlint
4755

48-
- uses: actions/checkout@v4
49-
with:
50-
fetch-depth: ${{ inputs.fetch-depth }}
51-
ref: ${{ github.head_ref }}
52-
53-
- name: 'get base branch last commit'
54-
run: git fetch origin ${{ inputs.base-branch }}:${{ inputs.base-branch }} --depth 1
55-
shell: bash
56-
if: ${{ github.ref_name != inputs.base-branch }}
57-
5856
- name: check commits
5957
run: ./convcommitlint -b main --create-review="true" --comment-drafts="false"
6058
env:

0 commit comments

Comments
 (0)