Fix setting DEBUG_ARGS (#1558)

Looks like context variable `runner` isn't available on the job level
`env`. It's available on the step level `env` though.
This commit is contained in:
Daniel Chao
2026-04-24 19:34:08 -07:00
committed by GitHub
parent 87b15f7a70
commit c4f56bf20d
6 changed files with 687 additions and 87 deletions
+15 -3
View File
@@ -3,6 +3,7 @@ abstract module GradleJob
extends "PklJob.pkl"
import "@gha/Workflow.pkl"
import "@gha/context.pkl"
import "@pkl.impl.ghactions/catalog.pkl"
/// Whether this is a release build or not.
@@ -44,9 +45,6 @@ fixed job {
when (os == "windows") {
["JAVA_HOME"] = "/jdk"
}
["DEBUG_ARGS"] =
// language=GithubExpressionLanguage
"${{ case(runner.debug == '1', '--info --stacktrace', '') }}"
}
when (os == "macOS") {
`if` =
@@ -99,6 +97,20 @@ fixed job {
}
}
}
new {
name = "Set DEBUG_ARGS env var"
env {
["RUNNER_DEBUG"] = context.runner.debug
}
shell = "bash"
// language=bash
run =
"""
if [[ "$RUNNER_DEBUG" -eq 1 ]]; then
echo "DEBUG_ARGS=--info --stacktrace" >> $GITHUB_ENV
fi
"""
}
...module.steps
}
}