Skip to content

fix(user): change username to optional field #143

fix(user): change username to optional field

fix(user): change username to optional field #143

Workflow file for this run

name: Pre-Commit & JS Checks
on:
pull_request:
jobs:
pre_commit_checks:
name: Pre-Commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: ./functions/package.json
- name: Setup node environment
uses: actions/setup-node@v4
with:
node-version-file: ./functions/package.json
cache: 'pnpm'
cache-dependency-path: ./functions/pnpm-lock.yaml
- name: Setup python environment
working-directory: ./functions/generated/pyfirebase
run: uv venv
- name: Check if uv lockfile is up-to-date
working-directory: ./functions/generated/pyfirebase
run: uv lock --locked --offline
- name: Install python dependencies
working-directory: ./functions/generated/pyfirebase
run: uv sync --all-extras
- name: Install pre-commit and run
uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual --show-diff-on-failure
- name: Install JS dependencies
working-directory: ./functions
run: pnpm install --frozen-lockfile
- name: Generate python definition files
working-directory: ./functions
run: pnpm generate:py
- name: Run pre-commit for generated python definition files
run: |
# NOTE: We do not want to terminate when pre-commit fails
set +e
# NOTE: Run pre-commit multiple times because some hooks auto-fix
# files and require re-runs to fully clean the codebase.
max_attempts=5
attempt=1
while [ $attempt -le $max_attempts ]; do
echo "ℹ️ Pre-commit attempt $attempt..."
pre-commit run --all-files
STATUS=$?
if [[ $STATUS -eq 0 ]]; then
echo "✅ Pre-commit passed after $attempt attempts."
exit 0
fi
attempt=$((attempt + 1))
done
echo "❌ Pre-commit did not converge after $max_attempts attempts."
git status
git --no-pager diff
exit 1
- name: Check if generated definition files are up to date.
run: |
if ! git diff --quiet ./functions/generated/; then
echo "❌ Generated definition files are not up-to-date. Run 'pnpm generate:py' to update the generated definitionfiles."
git status
git --no-pager diff
exit 1
fi
js_checks:
name: JS Lint & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: ./functions/package.json
- name: Setup node environment
uses: actions/setup-node@v4
with:
node-version-file: ./functions/package.json
cache: 'pnpm'
cache-dependency-path: ./functions/pnpm-lock.yaml
- name: Install JS dependencies
working-directory: ./functions
run: pnpm install --frozen-lockfile
- name: Run lint
working-directory: ./functions
run: pnpm lint
- name: Build project
working-directory: ./functions
run: pnpm build