Skip to content

fix(action): rely on runner-provided INPUT_* env vars for docker action - #334

Open
trcjr wants to merge 2 commits into
vladopajic:mainfrom
trcjr:fix/forgejo-inputs
Open

fix(action): rely on runner-provided INPUT_* env vars for docker action#334
trcjr wants to merge 2 commits into
vladopajic:mainfrom
trcjr:fix/forgejo-inputs

Conversation

@trcjr

@trcjr trcjr commented Jul 30, 2026

Copy link
Copy Markdown

fix(action): rely on runner-provided INPUT_* env vars for docker action

Summary

Remove the explicit env: mapping of INPUT_* variables from runs in action.yml and rely on runner-provided INPUT_<NAME> environment variables inside the container.

Problem

Some CI runners (notably Forgejo/Gitea runners) do not expand ${{ inputs.<name> }} inside the env: block for Docker actions the same way GitHub's runner does. That caused inputs such as INPUT_CONFIG to be the literal ${{ inputs.<name> }} inside the container, breaking action behavior on those runners.

Solution

Remove the env: block that re-mapped inputs to INPUT_* in action.yml and let the runner supply the standard INPUT_<NAME> env vars (the container entrypoint already reads those). This avoids overriding or mismatching runner-supplied values and improves compatibility across runners.

Files changed

  • action.yml (removed env: block mapping INPUT_*)
  • Entrypoint that reads the envs: docker-entrypoint.sh

Testing performed

  • Unit tests: make test (integration tests that call the GitHub API were skipped locally by unsetting GITHUB_TOKEN).
  • Coverage: make check-coverage (passes using .github/.testcoverage-local.yml).
  • Lint: make lint (0 issues).
  • Forgejo CI Runners consume the action as expected.

How to verify locally

Integration tests that call GitHub's API require a valid GITHUB_TOKEN; to run checks without those external calls:

# run unit tests (skip GitHub integration tests by clearing token)
env GITHUB_TOKEN= make test

# run coverage checks (uses .testcoverage-local.yml)
env GITHUB_TOKEN= make check-coverage

# run linter
make lint

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-runner compatibility for the Docker-based GitHub Action by removing an env: block that explicitly mapped inputs.* into INPUT_* variables, and instead relying on the standard runner-provided INPUT_<NAME> environment variables inside the container.

Changes:

  • Removed the runs.env remapping of action inputs to INPUT_* variables in action.yml.
  • Ensured the container continues to consume inputs via runner-provided INPUT_* env vars (as expected for Docker actions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vladopajic

Copy link
Copy Markdown
Owner

hey @trcjr thanks for contribution!

tho, this pr is not really correct, for github action inputs from action are passed to docker image via env variables.

unfortunately, ci cant run for external contributors, so i created same pr like yours to share ci result:
https://github.com/vladopajic/go-test-coverage/actions/runs/30585750810/job/91016762312?pr=335

@vladopajic vladopajic mentioned this pull request Jul 30, 2026
@trcjr
trcjr force-pushed the fix/forgejo-inputs branch from b817848 to 529817e Compare July 31, 2026 15:40
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.

3 participants