Skip to content

Add --github to print GitHub Actions annotations - #3

Merged
Gulliby merged 1 commit into
mainfrom
feature/github-annotations
Oct 13, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/github-annotations

Conversation

@Gulliby

@Gulliby Gulliby commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Before

envguard could print a human-readable report or JSON. In a GitHub Actions job the problems showed up only as log text, not as annotations on the run or the pull request.

After

envguard --github prints one workflow command per problem: missing and empty keys are ::error, extra keys are ::warning (errors with --strict). Nothing is printed when there is nothing to report. --json and --github cannot be combined (exit 2). Values are never printed, and file paths and messages are escaped as GitHub requires.

With A=,B=,C= in .env.example and A=1,C=,CI=true in .env:

::error file=.env,title=envguard::Missing key B (required by .env.example)
::error file=.env,title=envguard::Empty value for key C
::warning file=.env,title=envguard::Extra key CI (not in .env.example)

How

  • src/format.ts: the annotation formatter and escaping.
  • src/cli.ts: the --github option and its conflict check with --json.
  • README.md: option row, a new GitHub Actions annotations section, exit-code note.
  • tests/github.test.ts (new) and tests/cli.test.ts: 13 new tests; 147 pass in total.

@Gulliby
Gulliby merged commit cfd043e into main Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant