Skip to content
Latchkey

Publish @northsh/pysigma-node workflow (northsh/detection.studio)

The Publish @northsh/pysigma-node workflow from northsh/detection.studio, explained and optimized by Latchkey.

F

CI health: F - at risk

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

Grade your own workflow free or run it on Latchkey →
Source: northsh/detection.studio.github/workflows/publish-pysigma-node.ymlLicense MITView source

What it does

This is the Publish @northsh/pysigma-node workflow from the northsh/detection.studio 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)
name: Publish @northsh/pysigma-node

on:
    push:
        tags:
            - "pysigma-node-v*"
    workflow_dispatch:

permissions:
    contents: read
    id-token: write # required for npm trusted publishing (OIDC) + provenance

jobs:
    publish:
        name: Build, test & publish to npm
        runs-on: ubuntu-latest

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

            - name: Set up Bun
              uses: oven-sh/setup-bun@v2

            # setup-node configures the npmjs registry in ~/.npmrc. No auth
            # token is written - authentication happens via OIDC at publish time.
            - name: Set up Node.js
              uses: actions/setup-node@v4
              with:
                  node-version: 22
                  registry-url: "https://registry.npmjs.org"

            # Trusted publishing (OIDC) requires npm >= 11.5.1, which is newer
            # than the npm bundled with Node 22 / Bun.
            - name: Upgrade npm for trusted publishing
              run: npm install -g npm@latest

            - name: Install dependencies
              run: bun install

            - name: Build package
              run: bun run build
              working-directory: packages/pysigma-node

            - name: Run package tests
              run: bun run test
              working-directory: packages/pysigma-node

            # No NODE_AUTH_TOKEN: npm authenticates to the registry via the
            # workflow's OIDC identity (configure a trusted publisher for this
            # package + workflow on npmjs.com). Provenance is emitted
            # automatically when publishing via OIDC.
            - name: Publish to npm (OIDC trusted publishing)
              run: npm publish --access public
              working-directory: packages/pysigma-node

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.

name: Publish @northsh/pysigma-node
 
on:
    push:
        tags:
            - "pysigma-node-v*"
    workflow_dispatch:
 
permissions:
    contents: read
    id-token: write # required for npm trusted publishing (OIDC) + provenance
 
concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true
 
jobs:
    publish:
        timeout-minutes: 30
        name: Build, test & publish to npm
        runs-on: latchkey-small
 
        steps:
            - name: Checkout repository
              uses: actions/checkout@v4
 
            - name: Set up Bun
              uses: oven-sh/setup-bun@v2
 
            # setup-node configures the npmjs registry in ~/.npmrc. No auth
            # token is written - authentication happens via OIDC at publish time.
            - name: Set up Node.js
              uses: actions/setup-node@v4
              with:
                  cache: 'npm'
                  node-version: 22
                  registry-url: "https://registry.npmjs.org"
 
            # Trusted publishing (OIDC) requires npm >= 11.5.1, which is newer
            # than the npm bundled with Node 22 / Bun.
            - name: Upgrade npm for trusted publishing
              run: npm install -g npm@latest
 
            - name: Install dependencies
              run: bun install
 
            - name: Build package
              run: bun run build
              working-directory: packages/pysigma-node
 
            - name: Run package tests
              run: bun run test
              working-directory: packages/pysigma-node
 
            # No NODE_AUTH_TOKEN: npm authenticates to the registry via the
            # workflow's OIDC identity (configure a trusted publisher for this
            # package + workflow on npmjs.com). Provenance is emitted
            # automatically when publishing via OIDC.
            - name: Publish to npm (OIDC trusted publishing)
              run: npm publish --access public
              working-directory: packages/pysigma-node
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

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