Skip to content

Commit b894807

Browse files
committed
ci: Use test build to check commits
use the test build to check commits and make sure it works as expected on gh actions
1 parent fefdee6 commit b894807

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/test.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,35 @@ jobs:
4545
- name: test build
4646
run: go build -o convcommitlint
4747

48-
convcommitlint:
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: convcommitlint
51+
path: convcommitlint
52+
53+
54+
check-commits:
4955
runs-on: ubuntu-latest
56+
needs: test
5057
steps:
5158
- uses: actions/checkout@v4
52-
- uses: ./
59+
with:
60+
fetch-depth: 0
61+
ref: ${{ github.head_ref }}
62+
63+
- name: 'get base branch last commit'
64+
run: git fetch origin main:main --depth 1
65+
shell: bash
66+
if: ${{ github.ref_name != 'main' }}
67+
68+
- uses: actions/download-artifact@v4
69+
with:
70+
name: convcommitlint
71+
72+
- name: chmod +x
73+
run: chmod +x convcommitlint
74+
75+
- name: check commits
76+
run: ./convcommitlint -b main --create-review="true" --comment-drafts="false"
5377
env:
5478
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5579

0 commit comments

Comments
 (0)