Skip to content

feat: GitHub Action for CI/CD hosts file setup #46

@cjimti

Description

@cjimti

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions