diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2024-04-27 12:09:18 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2024-04-29 21:33:17 +0200 |
| commit | b194d5ce4460a843ba40cfc48d0073a455905711 (patch) | |
| tree | d93d19cc89406daab3a925da58e21d4822b7c5a7 /src/ci/github-actions | |
| parent | adbc84cfacc1d6b73864cdf62592f8db507b6ac3 (diff) | |
Output `run_type` from the matrix calculation job
Diffstat (limited to 'src/ci/github-actions')
| -rwxr-xr-x | src/ci/github-actions/calculate-job-matrix.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ci/github-actions/calculate-job-matrix.py b/src/ci/github-actions/calculate-job-matrix.py index 62cc867fac7..68565f489c9 100755 --- a/src/ci/github-actions/calculate-job-matrix.py +++ b/src/ci/github-actions/calculate-job-matrix.py @@ -106,6 +106,17 @@ def get_github_ctx() -> GitHubCtx: ) +def format_run_type(run_type: WorkflowRunType) -> str: + if run_type == WorkflowRunType.PR: + return "pr" + elif run_type == WorkflowRunType.Auto: + return "auto" + elif run_type == WorkflowRunType.Try: + return "try" + else: + raise AssertionError() + + if __name__ == "__main__": logging.basicConfig(level=logging.INFO) @@ -124,6 +135,8 @@ if __name__ == "__main__": if run_type is not None: jobs = calculate_jobs(run_type, data) jobs = skip_jobs(jobs, channel) + run_type = format_run_type(run_type) - logging.info(f"Output:\n{yaml.dump(jobs, indent=4)}") + logging.info(f"Output:\n{yaml.dump(dict(jobs=jobs, run_type=run_type), indent=4)}") print(f"jobs={json.dumps(jobs)}") + print(f"run_type={run_type}") |
