Use workflow-setup outputs for repo name; inline safe step-outcome expressions#427
Merged
Use workflow-setup outputs for repo name; inline safe step-outcome expressions#427
Conversation
Copilot
AI
changed the title
[WIP] Fix undesirable behavior changes in CI checks
Fix clang-tidy check regressions: fail-only-on-build-failure and comment posting
Mar 16, 2026
Copilot
AI
changed the title
Fix clang-tidy check regressions: fail-only-on-build-failure and comment posting
Fix clang-tidy check regressions: fail policy, PR comments, and exclude-globs support
Mar 16, 2026
Copilot
AI
changed the title
Fix clang-tidy check regressions: fail policy, PR comments, and exclude-globs support
Fix untrusted-code checkout (CodeQL #111) and missing Mar 16, 2026
exclude-globs input
Copilot
AI
changed the title
Fix untrusted-code checkout (CodeQL #111) and missing
Fix regressions in clang-tidy and coverage workflows introduced by #411/#423
Mar 16, 2026
exclude-globs input
Copilot
AI
changed the title
Fix regressions in clang-tidy and coverage workflows introduced by #411/#423
Fix regressions and complete code-injection sweep across .github/
Mar 16, 2026
Copilot
AI
changed the title
Fix regressions and complete code-injection sweep across .github/
Complete injection-safety sweep and fix clang-tidy-check regression
Mar 16, 2026
Copilot
AI
changed the title
Complete injection-safety sweep and fix clang-tidy-check regression
Use workflow-setup outputs for repo name; inline safe step-outcome expressions
Mar 16, 2026
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…lizing untrusted code Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…y-check, and coverage Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…false to read-only checkouts Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…t fail CI Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
…pressions Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
ed0f7b4 to
2cba387
Compare
Contributor
|
Review the full CodeQL report for details. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors multiple CI workflows to rely on workflow-setup outputs for repository identification (instead of github.event.repository.name) and simplifies shell logic by inlining safe step outcome expressions, while also tightening checkout behavior and improving relevance detection infrastructure.
Changes:
- Replace direct uses of
github.event.repository.namewithneeds.setup.outputs.repo(derivingREPO_NAMEviaREPO_NAME="${REPO##*/}") across check workflows. - Inline step outcome expressions (
${{ steps.*.outcome }}) instead of routing them through intermediate env vars; simplify several scripts by passing stable values viaenv. - Improve relevance detection plumbing: add
exclude-globs, switch togit ls-treeenumeration, and enable an “empty sparse-checkout” mode for change-detection checkouts.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/yaml-fix.yaml | Use working-directory instead of cd for formatter execution. |
| .github/workflows/yaml-check.yaml | Use needs.setup.outputs.repo to construct bot command hint; disable persisted checkout creds. |
| .github/workflows/python-check.yaml | Same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/markdown-check.yaml | Same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/jsonnet-format-fix.yaml | Use $GITHUB_WORKSPACE in docker volume mount (shell-native) for consistency. |
| .github/workflows/jsonnet-format-check.yaml | Same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/header-guards-check.yaml | Same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/dependabot-auto-merge.yaml | Replace expression-based event access with $GITHUB_EVENT_* + jq parsing; streamline env usage. |
| .github/workflows/coverage.yaml | Inline workflow_dispatch inputs via env; reduce repeated expressions; disable persisted checkout creds. |
| .github/workflows/codeql-analysis.yaml | Inline safe contexts via env; use $GITHUB_EVENT_* + jq for PR number; reduce expression repetition. |
| .github/workflows/cmake-format-fix.yaml | Use working-directory and run gersemi against .. |
| .github/workflows/cmake-format-check.yaml | Quote checkout path via env; same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/cmake-build.yaml | Use env for build path in cd; disable persisted checkout creds. |
| .github/workflows/clang-tidy-fix.yaml | Derive bot name from $GITHUB_REPOSITORY; make artifact fix application path-robust; add issues: write. |
| .github/workflows/clang-tidy-check.yaml | Disable persisted checkout creds; adjust failure/diagnostic handling and include bot hint in output. |
| .github/workflows/clang-format-check.yaml | Same repo/bot hint update; disable persisted checkout creds. |
| .github/workflows/actionlint-check.yaml | Use env-provided checkout path; mount via $GITHUB_WORKSPACE consistently; disable persisted checkout creds. |
| .github/actions/run-change-detection/action.yaml | Configure sparse checkout to avoid materializing PR files; thread through exclude-globs. |
| .github/actions/detect-relevant-changes/action.yaml | Add exclude-globs; replace find with git ls-tree enumeration to work under sparse/empty working trees. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
knoepfel
reviewed
Mar 16, 2026
knoepfel
reviewed
Mar 16, 2026
Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
knoepfel
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two issues with the check workflows:
github.event.repository.namewas used directly instead of the pre-sanitizedworkflow-setupoutputs, and step outcome values were unnecessarily wrapped in intermediate env vars despite being safe to inline.Changes
Replace
github.event.repository.namewithneeds.setup.outputs.repoacross all check workflows — derive the short name in bash viaREPO_NAME="${REPO##*/}". Inclang-tidy-fix.yamltheparse_commentstep runs beforeworkflow-setup, so$GITHUB_REPOSITORY(GitHub's built-in env var) is used instead.Remove unnecessary env-var wrappers for step outcomes —
LINT_OUTCOME,RUFF_OUTCOME,MYPY_OUTCOMEare always one of four controlled strings and are never user-provided; inlined directly as${{ steps.X.outcome }}.Preserve
clang-tidy-checknon-failing behavior — finding diagnostics emits::warning::but does not exit non-zero; only a build tooling failure (cmake exits without any diagnostic output) fails the job.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.