Skip to content

Resolve issue comment handling regressions#135

Merged
knoepfel merged 4 commits intoFramework-R-D:mainfrom
greenc-FNAL:bugfox/issue-comment-triggers
Dec 1, 2025
Merged

Resolve issue comment handling regressions#135
knoepfel merged 4 commits intoFramework-R-D:mainfrom
greenc-FNAL:bugfox/issue-comment-triggers

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

  • bugfix: Refactor issue-comment triggers in 'fix' workflows
  • refactor: Improve robustness of issue-comment triggers

This commit fixes a bug where issue comment triggers (e.g., '@phlexbot format') were no longer functional. The root cause was a fragile shell script in the 'parse-command' job of the 'fix' workflows.

The script has been replaced with a more robust and idiomatic GitHub Actions expression in a job-level 'if' condition. This new approach is more reliable, efficient, and easier to maintain.

The following workflows have been refactored:
- .github/workflows/clang-tidy-fix.yaml
- .github/workflows/clang-format-fix.yaml
- .github/workflows/cmake-format-fix.yaml
This commit refactors the GitHub Actions workflows that are triggered by issue comments to be more robust, secure, and maintainable.

The key changes are:

- Replaced fragile shell scripts with idiomatic job-level `if` conditions using the `startsWith()` function.
- Fixed a security vulnerability in `cmake-build.yaml` by adding a permission check to ensure that only collaborators and owners can trigger builds.
- Removed the issue comment trigger from `clang-tidy-check.yaml` to simplify the workflow and align it with the other "check" workflows.

These changes fix the original bug where issue comment triggers were not working, and they also improve the overall quality and consistency of the CI system.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refactors issue-comment triggered workflows to improve robustness by consolidating authorization and trigger phrase checks into job-level if conditions, eliminating redundant shell script steps. It also extracts PR information retrieval into a reusable composite action.

Key changes:

  • Consolidated authorization and trigger validation into declarative job-level if conditions across "fix" workflows
  • Replaced custom should_run output checks with GitHub's native needs.<job>.result == 'success' pattern
  • Created reusable get-pr-info composite action to eliminate code duplication
  • Removed issue_comment trigger from clang-tidy-check.yaml (check workflow now only handles pull_request events)

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/cmake-format-fix.yaml Refactored to use job-level authorization/trigger checks; references new get-pr-info action
.github/workflows/cmake-build.yaml Consolidated issue_comment trigger validation into job-level condition; removed redundant shell script check
.github/workflows/clang-tidy-fix.yaml Refactored to use job-level authorization/trigger checks; references new get-pr-info action
.github/workflows/clang-tidy-check.yaml Removed issue_comment trigger entirely; simplified to handle only pull_request and workflow_dispatch events
.github/workflows/clang-format-fix.yaml Refactored to use job-level authorization/trigger checks; references new get-pr-info action
.github/actions/get-pr-info/action.yaml New composite action to fetch PR details from issue_comment context using github-script

Comment thread .github/workflows/cmake-format-fix.yaml Outdated
Comment thread .github/workflows/clang-format-fix.yaml Outdated
Comment thread .github/workflows/clang-tidy-fix.yaml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/cmake-format-fix.yaml
Comment thread .github/workflows/clang-tidy-fix.yaml
Comment thread .github/workflows/clang-format-fix.yaml
@knoepfel knoepfel merged commit 8ac96b1 into Framework-R-D:main Dec 1, 2025
37 checks passed
greenc-FNAL pushed a commit that referenced this pull request Dec 1, 2025
This commit aligns the `python-check.yaml` and `python-fix.yaml` workflows with the consistency improvements and standards established in PR #135.

Key changes include:
- Refactoring `python-fix.yaml` to use a single-job design, moving the trigger logic into a job-level `if` condition.
- Correcting the `uses` syntax for internal reusable actions to use the full repository path and pin to `@main`, resolving a syntax error (`@main@main`).
@greenc-FNAL greenc-FNAL deleted the bugfox/issue-comment-triggers branch January 5, 2026 21:54
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