Skip to content

Commit d713884

Browse files
authored
chore(ci): skip tests if no changes under packages (#11288)
* chore(ci): skip tests if no changes under packages * also skip the build step
1 parent fd809cf commit d713884

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,22 @@ jobs:
9393
- name: Peek
9494
run: pnpm peek
9595
if: ${{ github.repository == 'nextauthjs/next-auth' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
96+
- name: Check for changes under /packages
97+
id: check-packages
98+
run: |
99+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^packages/'; then
100+
echo "PACKAGES_CHANGES=true" >> $GITHUB_ENV
101+
else
102+
echo "PACKAGES_CHANGES=false" >> $GITHUB_ENV
103+
fi
96104
- name: Build
105+
if: ${{ env.PACKAGES_CHANGES == 'true' }}
97106
run: pnpm build
98107
- name: Lint
99108
run: pnpm lint
100109
timeout-minutes: 15
101110
- name: Run unit tests
111+
if: ${{ env.PACKAGES_CHANGES == 'true' }}
102112
run: pnpm test
103113
- name: Get installed Playwright version
104114
id: playwright-version

0 commit comments

Comments
 (0)