Skip to content

Commit 6e0d454

Browse files
authored
Merge pull request #75 from GitGuardian/agateau/ci-improvements
CI improvements
2 parents 7cf0356 + aec3e3c commit 6e0d454

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/test-lint.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
lint:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
1922
- name: Set up Python 3.9
2023
uses: actions/setup-python@v1
2124
with:
@@ -40,15 +43,25 @@ jobs:
4043
env:
4144
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
4245

46+
- name: Check commit messages
47+
if: github.event_name == 'pull_request'
48+
run: |
49+
if git log --format=%s "origin/$GITHUB_BASE_REF..origin/$GITHUB_HEAD_REF" | grep '^fixup!' ; then
50+
echo 'Error: this pull request contains fixup commits. Squash them.'
51+
exit 1
52+
fi
53+
# In case `git log` fails
54+
exit "${PIPESTATUS[0]}"
55+
4356
build:
4457
runs-on: ${{ matrix.os }}
4558
strategy:
4659
fail-fast: false
4760
matrix:
4861
os: [ubuntu-latest, macos-latest, windows-latest]
49-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
62+
python-version: ['3.8', '3.9', '3.10', '3.11']
5063
steps:
51-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
5265

5366
- name: Set up Python ${{ matrix.python-version }}
5467
uses: actions/setup-python@v1
@@ -81,7 +94,7 @@ jobs:
8194
needs: [lint, build]
8295
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
8396
steps:
84-
- uses: actions/checkout@v3
97+
- uses: actions/checkout@v4
8598
with:
8699
fetch-depth: 0
87100

0 commit comments

Comments
 (0)