Skip to content

Commit

Permalink
fix: ci error
Browse files Browse the repository at this point in the history
  • Loading branch information
saseungmin committed Dec 4, 2024
1 parent 336f3b4 commit 75e30e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,19 @@ jobs:

- name: Compute Generate Data cache key
id: compute_generate_data_cache_key
run: echo "hash=${{ runner.os }}-generate-data-${{ hashFiles('apps/web/scripts/**') }}" >> $GITHUB_OUTPUT
run: |
SCRIPTS_HASH=$(find apps/web/scripts -type f -exec sha256sum {} \; | sort | sha256sum | cut -d' ' -f1)
echo "hash=${{ runner.os }}-generate-data-${SCRIPTS_HASH}" >> $GITHUB_OUTPUT
- name: Check Generate Data cache
uses: actions/cache@v4
id: cache_generated_data
with:
path: ${{ env.CACHED_GENERATED_STATIC_DATA_PATHS }}
key: ${{ steps.compute_generate_data_cache_key.outputs.hash }}

- name: Generate data
if: steps.compute_generate_data_cache_key.outputs.cache-hit != 'true'
if: steps.cache_generated_data.outputs.cache-hit != 'true'
run: yarn generate:applicant-count

outputs:
Expand Down
8 changes: 7 additions & 1 deletion apps/web/scripts/generate-applicant-count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { loadEnvConfig } from '@next/env';
import { JWT } from 'google-auth-library';
import { GoogleSpreadsheet } from 'google-spreadsheet';

import { checkNumber } from '../src/utils';
const checkNumber = (value?: number | null): number => {
if (typeof value === 'number') {
return value;
}

return 0;
};

const projectDir = process.cwd();
loadEnvConfig(projectDir);
Expand Down

0 comments on commit 75e30e3

Please sign in to comment.