txn2 / txn2/txeh

feat: GitHub Action for CI/CD hosts file setup

Open
#46 0 comments 0 reactions 1 assignee View on GitHub

@cjimti is already working on this.

Since Feb 8, 2026.

enhancement
Dominant language
Go
Stars
342
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Problem

CI jobs that test against named services need hosts file entries. Most projects handle this with a raw echo >> /etc/hosts step. Cleanup on failure usually doesn't happen.

Proposed solution

A GitHub Action in a separate repo (txn2/txeh-action) that wraps the txeh CLI. It adds entries in a setup step and removes them in a post step, so cleanup happens even if the job fails.

- uses: txn2/txeh-action@v1
  with:
    entries: |
      10.0.0.1 db.test.local
      10.0.0.2 api.test.local

Needs its own repo so GitHub Actions versioning (@v1 tags) works independently from the library's release tags.

Should work on Ubuntu, macOS, and Windows runners.

Alternatives considered

The echo >> /etc/hosts approach works fine for simple cases. The value here is mostly cleanup and cross-platform support, which may not justify a separate repo until profiles (#44) make setup/teardown more useful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.