Skip to content
Latchkey

ENV VARIABLE TEST workflow (Qliangw/notion_sync_data)

The ENV VARIABLE TEST workflow from Qliangw/notion_sync_data, explained and optimized by Latchkey.

A

CI health: A - excellent

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: Qliangw/notion_sync_data.github/workflows/test.yamlLicense MITView source

What it does

This is the ENV VARIABLE TEST workflow from the Qliangw/notion_sync_data 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: ENV VARIABLE TEST
  
on: [workflow_dispatch]

jobs:
  build:

    runs-on: windows-latest

    steps:
    - name: Set the value
      id: step_one
      run: |
        echo "action_state=yellow" | Out-File -FilePath $env:GITHUB_ENV -Append # no need for -Encoding utf8
    - name: Use the value
      id: step_two
      run: |
        echo "${{ env.action_state }}" # This will output 'yellow'

The same workflow, on Latchkey

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

name: ENV VARIABLE TEST
  
on: [workflow_dispatch]
 
jobs:
  build:
    timeout-minutes: 30
 
    runs-on: windows-latest
 
    steps:
    - name: Set the value
      id: step_one
      run: |
        echo "action_state=yellow" | Out-File -FilePath $env:GITHUB_ENV -Append # no need for -Encoding utf8
    - name: Use the value
      id: step_two
      run: |
        echo "${{ env.action_state }}" # This will output 'yellow'
 

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.