Skip to content
Latchkey

(Compiler) Publish Prereleases Manual workflow (react/react)

The (Compiler) Publish Prereleases Manual workflow from react/react, explained and optimized by Latchkey.

B

CI health: B - good

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: react/react.github/workflows/compiler_prereleases_manual.ymlLicense MITView source

What it does

This is the (Compiler) Publish Prereleases Manual workflow from the react/react 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: (Compiler) Publish Prereleases Manual

on:
  workflow_dispatch:
    inputs:
      prerelease_commit_sha:
        required: false
      release_channel:
        required: true
        type: string
      dist_tag:
        required: true
        type: string
      version_name:
        required: true
        type: string
      tag_version:
        required: false
        type: string
      dry_run:
        required: false
        type: boolean

permissions: {}

env:
  TZ: /usr/share/zoneinfo/America/Los_Angeles

jobs:
  publish_prerelease_experimental:
    name: Publish to Experimental channel
    uses: react/react/.github/workflows/compiler_prereleases.yml@main
    with:
      commit_sha: ${{ inputs.prerelease_commit_sha || github.sha }}
      release_channel: ${{ inputs.release_channel }}
      dist_tag: ${{ inputs.dist_tag }}
      version_name: ${{ inputs.version_name }}
      tag_version: ${{ inputs.tag_version }}
      dry_run: ${{ inputs.dry_run }}
    secrets:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: (Compiler) Publish Prereleases Manual
 
on:
  workflow_dispatch:
    inputs:
      prerelease_commit_sha:
        required: false
      release_channel:
        required: true
        type: string
      dist_tag:
        required: true
        type: string
      version_name:
        required: true
        type: string
      tag_version:
        required: false
        type: string
      dry_run:
        required: false
        type: boolean
 
permissions: {}
 
env:
  TZ: /usr/share/zoneinfo/America/Los_Angeles
 
jobs:
  publish_prerelease_experimental:
    timeout-minutes: 30
    name: Publish to Experimental channel
    uses: react/react/.github/workflows/compiler_prereleases.yml@main
    with:
      commit_sha: ${{ inputs.prerelease_commit_sha || github.sha }}
      release_channel: ${{ inputs.release_channel }}
      dist_tag: ${{ inputs.dist_tag }}
      version_name: ${{ inputs.version_name }}
      tag_version: ${{ inputs.tag_version }}
      dry_run: ${{ inputs.dry_run }}
    secrets:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 

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.

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