All Tools View Categories About Contact Privacy

.env to GitHub Actions Converter

Convert a .env file into GitHub Actions env: YAML, ${{ secrets.KEY }} references, or a secrets UI list.

Runs entirely in your browser — nothing is uploaded.

About .env to GitHub Actions Converter

Every GitHub Actions workflow that needs configuration ends up repeating the same dance: copying a .env into the env: block, deciding which values belong in repository secrets, and writing ${{ secrets.KEY }} references by hand. That repetition is where mistakes creep in — a missing quote breaks the YAML, a secret pasted into logs leaks, or a key name is mistyped.

The .env to GitHub Actions Converter generates the exact block you need. Emit a workflow env: section with correct YAML quoting, a set of ${{ secrets.KEY }} reference lines to drop into a step, or a plain list ready for the GitHub secrets UI. A smart detector recognizes secret-suffixed keys (like _SECRET or _KEY) so they route to secrets automatically, and every key is validated against GitHub's naming rules.

It is deterministic, reviewable and private — your values are processed entirely in the browser and never leave the page.

Features

  • Three output modes: env: YAML block, ${{ secrets.KEY }} lines, or a secrets UI list.
  • Smart YAML quoting: values are quoted only when needed.
  • Secret detection: keys ending in _SECRET or _KEY route to secrets automatically.
  • Secrets reference: optional wrap-all mode using ${{ secrets.KEY }}.
  • Key validation: checked against GitHub naming rules; duplicates flagged.
  • Comment control: keep or strip comments from the source .env.
  • Copy or download: clipboard or a .yml/.txt file in one click.
  • Private: all conversion happens in your browser.

How to Use

  1. Paste your .env content into the input box, or load the sample.
  2. Pick an output mode — workflow env block, secrets references, or secrets list.
  3. Toggle secret detection for _SECRET/_KEY suffixed keys if desired.
  4. Click Convert. The Actions-format output appears on the right.
  5. Review warnings above the output, then copy into your workflow or secrets UI.

Examples

Example 1 — Workflow env block. A maintainer converts their .env into an env: block and pastes it at the top of the workflow so every job sees the same configuration.

Example 2 — Secret references. An engineer emits ${{ secrets.API_KEY }} lines, adds the real values once in repo settings, and keeps the workflow file safe to commit.

Example 3 — Secret onboarding. A new contributor runs the converter, pastes the generated key list into the GitHub secrets UI, and the CI configuration references them without exposing values.

Example 4 — Environment-scoped secrets. A team maintains staging and production .env files and generates separate secrets lists per GitHub environment, then references environment-appropriate values in the workflow.

Example 5 — Secure templates. An open-source project ships a workflow template where all secrets are references, and the converter generates the matching .env.example for contributors.

Benefits

  • No YAML mistakes: quoting is handled automatically.
  • Secrets stay hidden: references keep values out of logs and repos.
  • Fast onboarding: generate the secrets list in seconds.
  • Key-safe: validated names and duplicate detection.
  • Deterministic: same input, same output, easy to review.
  • Private & free: browser-only, no account.

Frequently Asked Questions

What does this tool do?
It reads a .env file and produces GitHub Actions-ready output: a workflow env: YAML block, ${{ secrets.KEY }} reference lines for the workflow file, or a plain key list to paste into the GitHub secrets UI.
What is the difference between env and secrets?
The env: block in a workflow sets non-secret variables visible in logs. Secrets are stored in the repository or environment settings, masked in logs, and referenced as ${{ secrets.KEY }}. This tool lets you generate either, or a list to add secrets in the UI.
How does the env: block quote values?
Values are emitted as YAML with the same smart quoting as other converters: plain when safe, single-quoted when the value contains colons, hashes, brackets or spaces, so the workflow parses every time.
Can I mark some keys as secrets?
Yes. A marker in the key (for example _SECRET or _KEY suffix) can be detected automatically, or you can choose to emit every variable as a secrets reference.
Is my data uploaded?
No. Everything runs client-side in your browser. Nothing is sent to any server, stored or logged.
What are the key rules for GitHub?
env: keys can contain underscores and uppercase letters, and secret names are case-insensitive and cannot contain spaces. The tool validates keys and flags duplicates with line numbers.