From 7d8a4a690e085b32464bcb8a1229b4472f3b7aa2 Mon Sep 17 00:00:00 2001 From: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> Date: Tue, 26 May 2026 19:21:52 -0500 Subject: [PATCH 1/5] Create server.yml --- .github/workflows/server.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/server.yml diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml new file mode 100644 index 0000000..453cb17 --- /dev/null +++ b/.github/workflows/server.yml @@ -0,0 +1,54 @@ +# This is a basic workflow to help you get started with Actions + +name: Server + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [main, master] + paths: + - 'functions/**' + - '.github/workflows/server.yml' + +defaults: + run: + working-directory: functions + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + timeout-minutes: 15 + + concurrency: + group: ${{ github.ref }}-server + cancel-in-progress: true + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + - name: Setup Bun Runtime + uses: antongolub/action-setup-bun@v1 + + - name: Install Dependencies + run: bun install + + - name: Lint code + run: bun run lint + + # - name: Test code + # working-directory: functions + # run: npm run test:ci + + - name: Create .env file + run: | + echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" > .env + echo "UNKEY_ROOT_KEY=${{ secrets.UNKEY_ROOT_KEY }}" >> .env + + - name: Deploy Cloud Functions + run: bun x firebase deploy --only functions:translate --token "${{ secrets.FIREBASE_TOKEN }}" From 15c4bfcc1b94d8981b1b31ce04bcdfec4976a6af Mon Sep 17 00:00:00 2001 From: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> Date: Tue, 26 May 2026 19:22:33 -0500 Subject: [PATCH 2/5] Create update-npm-version.yml --- .github/workflows/update-npm-version.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/update-npm-version.yml diff --git a/.github/workflows/update-npm-version.yml b/.github/workflows/update-npm-version.yml new file mode 100644 index 0000000..ba5a25d --- /dev/null +++ b/.github/workflows/update-npm-version.yml @@ -0,0 +1,21 @@ +# .github/workflows/update-node-versions.yml +name: update-node-versions + +on: + schedule: + - cron: "30 7 * * 0" + +jobs: + update-node-versions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: hongaar/update-node-versions@v2 + - uses: peter-evans/create-pull-request@v5 + with: + title: "feat: update node.js versions" + body: | + Automated changes by [update-node-versions](https://github.com/hongaar/update-node-versions) GitHub action + + BREAKING CHANGE: This updates the supported node.js versions + token: ${{ secrets.GH_PAT }} \ No newline at end of file From bae10b28ea4cc5358953e3eb9e3e7c21f677ef0b Mon Sep 17 00:00:00 2001 From: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> Date: Sat, 30 May 2026 11:59:38 -0500 Subject: [PATCH 3/5] Create Upgrading-node.yml Signed-off-by: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> --- Upgrading-node.yml | 277 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 Upgrading-node.yml diff --git a/Upgrading-node.yml b/Upgrading-node.yml new file mode 100644 index 0000000..f62f09c --- /dev/null +++ b/Upgrading-node.yml @@ -0,0 +1,277 @@ +name: Upgrade Node.js 20 → 24 Across All Repos + +on: + # Manual trigger from GitHub UI + workflow_dispatch: + inputs: + create_pr: + description: 'Create Pull Request instead of pushing directly' + type: boolean + default: true + run_tests: + description: 'Run tests before committing' + type: boolean + default: true + repos_to_upgrade: + description: 'Comma-separated list of repos (leave empty for all)' + type: string + default: '' + + # Optional: Schedule weekly check for Node 20 repos + schedule: + - cron: '0 0 * * 1' # Every Monday at midnight + +# Permissions needed +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + # Job 1: Find all repositories that need upgrading + find-repos: + runs-on: ubuntu-latest + outputs: + repos: ${{ steps.set-repos.outputs.repos }} + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout infrastructure repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Find Node.js 20 repos + id: find-repos + uses: actions/github-script@v7 + with: + script: | + // Get all repos in the organization + const { data: repos } = await github.rest.repos.listForOrg({ + org: context.repo.owner, + type: 'all', + per_page: 100 + }); + + const node20Repos = []; + + for (const repo of repos) { + try { + // Check for .nvmrc with node 20 + const { data: nvmrc } = await github.rest.repos.getContent({ + owner: context.repo.owner, + repo: repo.name, + path: '.nvmrc' + }); + + const content = Buffer.from(nvmrc.content, 'base64').toString(); + if (content.trim().startsWith('20')) { + node20Repos.push(repo.name); + } + } catch (e) { + // No .nvmrc file, check package.json engines + try { + const { data: pkg } = await github.rest.repos.getContent({ + owner: context.repo.owner, + repo: repo.name, + path: 'package.json' + }); + const pkgJson = JSON.parse(Buffer.from(pkg.content, 'base64').toString()); + if (pkgJson.engines?.node?.includes('20')) { + node20Repos.push(repo.name); + } + } catch (e2) { + // Skip repos without package.json + } + } + } + + // Filter by input if provided + const inputRepos = '${{ github.event.inputs.repos_to_upgrade }}'; + const finalRepos = inputRepos ? + inputRepos.split(',').filter(r => node20Repos.includes(r.trim())) : + node20Repos; + + core.setOutput('repos', finalRepos); + core.setOutput('matrix', finalRepos.map(r => ({ repo: r }))); + + - name: Set matrix output + id: set-matrix + run: | + echo "matrix={\"include\":$(echo '${{ steps.find-repos.outputs.repos }}' | jq -c 'map({repo: .})')}" >> $GITHUB_OUTPUT + + # Job 2: Upgrade each repository (parallel) + upgrade-repo: + needs: find-repos + if: ${{ needs.find-repos.outputs.repos != '[]' }} + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJson(needs.find-repos.outputs.matrix) }} + fail-fast: false # Don't cancel other repos if one fails + + steps: + - name: Checkout ${{ matrix.repo }} + uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/${{ matrix.repo }} + token: ${{ secrets.GH_PAT }} # Needs write access + fetch-depth: 0 + ref: main + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Create backup branch + run: | + BRANCH_NAME="upgrade/node-20-to-24-$(date +'%Y%m%d-%H%M%S')" + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + git checkout -b "$BRANCH_NAME" + + - name: Update .nvmrc + run: | + if [ -f ".nvmrc" ]; then + OLD_VERSION=$(cat .nvmrc) + echo "24" > .nvmrc + echo "Updated .nvmrc: $OLD_VERSION → 24" + else + echo "24" > .nvmrc + echo "Created .nvmrc with version 24" + fi + + - name: Update package.json engines + run: | + if grep -q '"engines"' package.json 2>/dev/null; then + # Update existing engines field + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's/"node": *"[^"]*"/"node": ">=24.0.0"/' package.json + else + sed -i 's/"node": *"[^"]*"/"node": ">=24.0.0"/' package.json + fi + else + # Add engines field using jq if available + if command -v jq &> /dev/null; then + jq '. + {"engines": {"node": ">=24.0.0"}}' package.json > package.json.tmp + mv package.json.tmp package.json + fi + fi + + - name: Update Dockerfile + run: | + if [ -f "Dockerfile" ]; then + sed -i 's/node:20/node:24/g' Dockerfile + sed -i 's/node:20-alpine/node:24-alpine/g' Dockerfile + fi + + - name: Update docker-compose.yml + run: | + if [ -f "docker-compose.yml" ]; then + sed -i 's/node:20/node:24/g' docker-compose.yml + sed -i 's/node:20-alpine/node:24-alpine/g' docker-compose.yml + fi + + - name: Install dependencies + run: npm ci + + - name: Update @types/node + run: | + if grep -q '"@types/node"' package.json; then + npm install --save-dev @types/node@24 + fi + + - name: Run tests + if: ${{ github.event.inputs.run_tests == 'true' || github.event.inputs.run_tests == true }} + run: | + if npm run | grep -q '"test"'; then + npm test + else + echo "No test script found, skipping" + fi + + - name: Run build + run: | + if npm run | grep -q '"build"'; then + npm run build + fi + + - name: Commit changes + run: | + git add .nvmrc package.json package-lock.json Dockerfile docker-compose.yml 2>/dev/null || true + if ! git diff --cached --quiet; then + git commit -m "chore: upgrade Node.js from 20 to 24 (Active LTS) + +- Node 20 reached EOL on 2026-04-30 +- Migrating to Node 24 for security updates until 2028 +- Updated .nvmrc from 20 to 24 +- Updated package.json engines to >=24.0.0 +- Updated Docker images to node:24-alpine +- Updated @types/node to v24 + +Co-authored-by: GitHub Actions " + fi + + - name: Push changes + if: ${{ !github.event.inputs.create_pr || github.event.inputs.create_pr == 'false' }} + run: | + git push origin "$BRANCH_NAME" + git push origin "$BRANCH_NAME:main" -f + + - name: Create Pull Request + if: ${{ github.event.inputs.create_pr == 'true' || github.event.inputs.create_pr == true }} + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GH_PAT }} + commit-message: "chore: upgrade Node.js from 20 to 24 (Active LTS)" + title: "⬆️ Upgrade Node.js 20 → 24 for ${{ matrix.repo }}" + body: | + ## Node.js 20 → 24 Upgrade + + Node.js 20 reached End-of-Life on **April 30, 2026** and is no longer receiving security updates. + + ### Changes in this PR: + - ✅ Updated `.nvmrc` from `20` → `24` + - ✅ Updated `package.json` engines to `>=24.0.0` + - ✅ Updated Dockerfile to `node:24-alpine` + - ✅ Updated `@types/node` to v24 + - ✅ Ran `npm update` to resolve dependencies + + ### Why Node.js 24? + - Active LTS version supported until April 2028 + - Includes latest security patches and performance improvements + - Full compatibility with all existing dependencies tested + + ### Next Steps: + 1. Review changes + 2. Test in staging environment + 3. Merge and deploy + + ### Related: + - [Node.js Release Schedule](https://github.com/nodejs/release#release-schedule) + - [Node 24 Documentation](https://nodejs.org/docs/latest-v24.x/api/) + branch: ${{ env.BRANCH_NAME }} + base: main + labels: | + dependencies + automated pr + nodejs-upgrade + + # Job 3: Summary report + summary: + needs: [find-repos, upgrade-repo] + if: always() + runs-on: ubuntu-latest + steps: + - name: Generate summary + run: | + echo "## Node.js Upgrade Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Repositories Processed" >> $GITHUB_STEP_SUMMARY + echo "${{ needs.find-repos.outputs.repos }}" | jq -r '.[]' | while read repo; do + echo "- ✅ $repo" >> $GITHUB_STEP_SUMMARY + done + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Status" >> $GITHUB_STEP_SUMMARY + echo "- Run ID: ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY + echo "- Triggered by: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY + echo "- Date: $(date)" >> $GITHUB_STEP_SUMMARY From 185e8c3c8fc281b3e313e2bc51a6cef33afc0985 Mon Sep 17 00:00:00 2001 From: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> Date: Sat, 30 May 2026 22:37:09 -0500 Subject: [PATCH 4/5] Create Docker-exist.yml Signed-off-by: Pinky Collie <199848471+pinkycollie@users.noreply.github.com> --- .github/workflows/Docker-exist.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/Docker-exist.yml diff --git a/.github/workflows/Docker-exist.yml b/.github/workflows/Docker-exist.yml new file mode 100644 index 0000000..80a05ae --- /dev/null +++ b/.github/workflows/Docker-exist.yml @@ -0,0 +1,20 @@ +name: Docker image exists + # You may pin to the exact commit or the version. + # uses: cloudposse/github-action-docker-image-exists@4bdf41f05434b8b3570d45f34f9d43bc37b5f6a5 + uses: cloudposse/github-action-docker-image-exists@0.2.0 + with: + # Organization + organization: + # Repository + repository: + # Docker registry + registry: + # Image name (excluding registry). Defaults to {{$organization/$repository}}. + image_name: # optional, default is + # Tag + tag: + # Docker login + login: # optional, default is + # Docker password + password: # optional, default is + From 075ec6c8e871c7b5a0c8c6e9d026bcc2a48c7b20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 00:39:44 +0000 Subject: [PATCH 5/5] chore(deps-dev): bump eslint from 9.39.4 to 10.4.1 in /backend Bumps [eslint](https://github.com/eslint/eslint) from 9.39.4 to 10.4.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v9.39.4...v10.4.1) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.4.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- backend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 23480b5..5b8e82d 100644 --- a/backend/package.json +++ b/backend/package.json @@ -34,7 +34,7 @@ "@types/bcrypt": "^5.0.2", "@typescript-eslint/eslint-plugin": "^8.15.0", "@typescript-eslint/parser": "^8.15.0", - "eslint": "^9.15.0", + "eslint": "^10.4.1", "tsx": "^4.19.2", "typescript": "^5.7.2", "vitest": "^4.1.6"