Skip to content
Latchkey

Check package versions workflow (Mintplex-Labs/anything-llm)

The Check package versions workflow from Mintplex-Labs/anything-llm, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: Mintplex-Labs/anything-llm.github/workflows/check-package-versions.yamlLicense MITView source

What it does

This is the Check package versions workflow from the Mintplex-Labs/anything-llm repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
# This GitHub action is for checking the versions of the packages in the project.
# Any package that is present in both the `server` and `collector` package.json file
# is checked to ensure that they are the same version.
name: Check package versions

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

on:
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - "server/package.json"
      - "collector/package.json"

jobs:
  run-script:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'

      - name: Run verifyPackageVersions.mjs script
        run: |
          cd extras/scripts
          node verifyPackageVersions.mjs

      - name: Fail job on error
        if: failure()
        run: exit 1

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

# This GitHub action is for checking the versions of the packages in the project.
# Any package that is present in both the `server` and `collector` package.json file
# is checked to ensure that they are the same version.
name: Check package versions
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
on:
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - "server/package.json"
      - "collector/package.json"
 
jobs:
  run-script:
    timeout-minutes: 30
    runs-on: latchkey-small
 
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
 
      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          cache: 'npm'
          node-version: '18'
 
      - name: Run verifyPackageVersions.mjs script
        run: |
          cd extras/scripts
          node verifyPackageVersions.mjs
 
      - name: Fail job on error
        if: failure()
        run: exit 1
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow