GitHub Action to install and configure the DevHelm CLI for monitoring-as-code workflows.
- uses: actions/checkout@v4
- uses: devhelmhq/setup-devhelm@v1
- run: devhelm validate- uses: devhelmhq/setup-devhelm@v1
with:
devhelm-version: '0.1.4'- uses: devhelmhq/setup-devhelm@v1
with:
api-token: ${{ secrets.DEVHELM_API_TOKEN }}
org-id: ${{ vars.DEVHELM_ORG_ID }}
workspace-id: ${{ vars.DEVHELM_WORKSPACE_ID }}
verify-connection: truename: DevHelm Monitoring as Code
on:
push:
branches: [main]
paths: ['devhelm.yml']
pull_request:
paths: ['devhelm.yml']
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: devhelmhq/setup-devhelm@v1
- run: devhelm validate
deploy:
if: github.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: devhelmhq/setup-devhelm@v1
with:
api-token: ${{ secrets.DEVHELM_API_TOKEN }}
org-id: ${{ vars.DEVHELM_ORG_ID }}
workspace-id: ${{ vars.DEVHELM_WORKSPACE_ID }}
verify-connection: true
- run: devhelm deploy devhelm.yml
- run: devhelm status --output json| Input | Required | Default | Description |
|---|---|---|---|
devhelm-version |
No | latest |
CLI version — exact semver (e.g. 0.1.4) or latest |
api-token |
No | — | DevHelm API token. Pass via secrets.DEVHELM_API_TOKEN |
api-url |
No | — | API base URL (default: https://api.devhelm.io) |
org-id |
No | — | Organization ID for multi-org accounts |
workspace-id |
No | — | Workspace ID for multi-workspace accounts |
verify-connection |
No | false |
Run devhelm auth me after setup to verify credentials |
node-version |
No | 20 |
Node.js version to install only if none is detected on PATH (or if detected version is <18). Existing Node >=18 is preserved as-is. Set to '' to skip auto-install entirely |
| Output | Description |
|---|---|
devhelm-version |
Installed CLI version (e.g. 0.1.4) |
cache-hit |
true if the npm cache was restored |
- Node.js — detects an existing
nodeonPATH; if it's>=18, the action keeps it and skipsactions/setup-nodeentirely. Otherwise it installsnode-version(default20) viaactions/setup-node. - Cache — restores
~/.npmcache keyed on OS + CLI version - Install — runs
npm install -g devhelm@<version> - Environment — exports
DEVHELM_API_TOKEN,DEVHELM_API_URL,DEVHELM_ORG_ID,DEVHELM_WORKSPACE_IDfor all subsequent steps - Verify — optionally runs
devhelm auth meto fail fast on bad credentials
If your workflow already runs actions/setup-node@v4 (or otherwise pins a Node version) before this action, your Node version is preserved. The action only installs Node when none is on PATH or the detected major is <18. You no longer need to set node-version: '' to avoid being silently downgraded.
- Never hardcode tokens in workflow files. Use GitHub Secrets.
- The
api-tokeninput is passed through environment variables, never logged. - For org/workspace IDs (non-sensitive), use GitHub Variables.
- Node.js >= 18 — if not present (or the detected version is
<18), the action installs Node 20 by default. Any pre-existing Node>=18set up by an earlier step is left untouched. Setnode-version: ''to skip the install fallback entirely (the action will then error if Node is missing). - npm — ships with Node.js.
MIT — see LICENSE.
Setup DevHelm CLI is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.