Sets the environment to the proper C++ Build Environment for Wise GCC Toolset.
  • PowerShell 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-31 08:28:25 -07:00
action.yml first commit 2026-07-31 08:28:25 -07:00
README.md first commit 2026-07-31 08:28:25 -07:00
Set-BuildVars.ps1 first commit 2026-07-31 08:28:25 -07:00

setvars action

Sources C:/build/setvars64.bat (or setvars32.bat) and pushes every variable it sets into the job environment, so all later steps inherit the toolchain.

A batch file runs in its own cmd.exe; its set calls vanish when that process exits. This action dumps the environment before and after calling the script inside a single cmd.exe, diffs the two, and republishes the delta through $GITHUB_ENV (which Forgejo's runner honours).

Usage

- uses: actions/checkout@v4
- uses: ./.forgejo/actions/setvars
  with:
    arch: '64'

Requires a self-hosted Windows runner running jobs on the host (not in a container), since it reads C:/build.

Inputs

Input Default Description
arch 64 64 or 32. x64/amd64/x86/win32 also accepted.
root C:/build Directory containing setvars64.bat / setvars32.bat.
script (empty) Full path to a specific vars script; overrides arch/root.
path-mode env env writes the full resolved PATH to GITHUB_ENV. github-path appends only the newly added entries to GITHUB_PATH.

Outputs

Output Description
script-path Absolute path of the script that was sourced.
changed-vars Comma-separated names of the exported variables.

Notes

  • Values are written using the NAME<<delimiter heredoc form, so multi-line and quote-containing values survive intact.
  • PATH defaults to path-mode: env because that reproduces the script's ordering exactly. github-path is the more idiomatic mechanism, but runners differ on the order in which they prepend multiple GITHUB_PATH lines — only use it if you don't care about the relative order of the added directories.
  • Variables the script unsets cannot be removed via GITHUB_ENV; the action emits a warning if that happens.
  • Nothing about it is toolchain-specific — point script at vcvars64.bat or any other batch file and it behaves the same way.

Using it from other repos

Move this directory into its own Forgejo repo (with action.yml at the root) and reference it as uses: your-org/setvars-action@v1.