Skip to content

Commit 2b50ac3

Browse files
committed
ci: Fix cash for nx
1 parent 49de0ac commit 2b50ac3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ jobs:
1616
fetch-depth: 0
1717
- name: Npm install
1818
uses: ./.github/actions
19-
- name: Branch name
20-
run: echo running on branch ${GITHUB_REF##*/}
19+
- name: Get branch names.
20+
id: branch-names
21+
uses: tj-actions/branch-names@v8
22+
23+
- name: Running on the default branch.
24+
if: steps.branch-names.outputs.is_default == 'true'
25+
run: |
26+
echo "Running on default: ${{ steps.branch-names.outputs.current_branch }}"
2127
- name: Restore cached .nx
2228
id: cache-nx-restore
2329
uses: actions/cache/restore@v4
2430
with:
2531
path: |
2632
.nx
27-
key: ${{ runner.os }}-nx-${GITHUB_REF##*/}
33+
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}"
2834
- run: git branch --track main origin/master
2935
- name: Test and build
3036
run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source'

0 commit comments

Comments
 (0)