elastic / elastic/ai-github-actions

fix: remove direct comment triggers from mention-in-issue-by-id

Open
#1,298 0 comments 0 reactions 0 assignees View on GitHub
agentic-workflows
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

> [!CAUTION]
> Protected files were modified in this change.
> This pull request is in `request_review` mode and requires explicit human scrutiny before merge.
>
> Protected files: `.github/workflows/gh-aw-mention-in-issue-by-id.lock.yml`, `.github/workflows/gh-aw-mention-in-issue-by-id.md`

## Root Cause

The `gh-aw-mention-in-issue-by-id` workflow had `on: issue_comment`, `on: pull_request_review_comment`, and `on: discussion_comment` triggers. When any org member (OWNER/MEMBER/COLLABORATOR) commented on an issue, the workflow was triggered directly — **bypassing `workflow_call`**.

The `model` input has a default of `gpt-5.3-codex` only for `workflow_call`. When triggered by a direct comment event, `inputs.model` is empty (GitHub Actions does not populate `workflow_call` inputs for other event types). This caused the Copilot CLI to fail with:

```
BYOK providers require an explicit model. Run `copilot help providers` for configuration details.
```

## Why the direct triggers were wrong

`mention-in-issue-by-id` requires `target-issue-number` and `prompt` as **required `workflow_call` inputs** — they cannot be provided by a comment event. The workflow was never functional when triggered this way; it just produced spurious failures logged as issue #1293.

## Fix

Removed `issue_comment`, `pull_request_review_comment`, and `discussion_comment` triggers from the source `.md` file and recompiled with `gh aw compile v0.79.6`. The workflow now only responds to `workflow_call`.

Closes \#1293

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Mention in Issue (no sandbox)](https://github.com/elastic/ai-github-actions/actions/runs/27623842975)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

---

> [!NOTE]
> This was originally intended as a pull request, but the git push operation failed.
>
> **Workflow Run:** [View run details and download bundle artifact](https://github.com/elastic/ai-github-actions/actions/runs/27623842975)
>
> The bundle file is available in the `agent` artifact in the workflow run linked above.

To create a pull request with the changes:

```sh
# Download the artifact from the workflow run
gh run download 27623842975 -n agent -D /tmp/agent-27623842975

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-27623842975/aw-fix-mention-in-issue-by-id-empty-model.bundle refs/heads/fix/mention-in-issue-by-id-empty-model:refs/bundles/create-pr-fix-mention-in-issue-by-id-empty-model-0a18a08df2aea5d1-1339c1cf
git update-ref refs/heads/fix/mention-in-issue-by-id-empty-model-0a18a08df2aea5d1 refs/bundles/create-pr-fix-mention-in-issue-by-id-empty-model-0a18a08df2aea5d1-1339c1cf
git checkout fix/mention-in-issue-by-id-empty-model-0a18a08df2aea5d1
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-fix-mention-in-issue-by-id-empty-model-0a18a08df2aea5d1-1339c1cf

# Push the branch to origin
git push origin fix/mention-in-issue-by-id-empty-model-0a18a08df2aea5d1

# Create the pull request
gh pr create --title 'fix: remove direct comment triggers from mention-in-issue-by-id' --base main --head fix/mention-in-issue-by-id-empty-model-0a18a08df2aea5d1 --repo elastic/ai-github-actions
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.