elastic / elastic/ai-github-actions

Fix duplicate `with` guidance in generated dogfood triggers

Open
#1,136 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

## Summary
This fixes invalid YAML guidance in generated trigger workflows where uncommenting label/config examples could create a duplicate `with:` key.

### What changed
- Updated `scripts/dogfood.sh` override injection logic to also detect commented `# with:` blocks in `run` jobs.
- While injecting dogfood `with` overrides, the script now preserves nested comment guidance from the original block and emits it under a single active `with:` mapping.
- Regenerated affected triggers:
- `.github/workflows/trigger-issue-triage.yml`
- `.github/workflows/trigger-text-auditor.yml`

## Result
Generated dogfood trigger workflows now keep one `with:` block with optional commented guidance and active override values together, so enabling commented options no longer introduces duplicate YAML keys.

Closes #1135.

## Checks
- `make lint-workflows`
- strict duplicate-key YAML parse check on `trigger-issue-triage.yml` after enabling `classification-labels` guidance

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Bug Hunter](https://github.com/elastic/ai-github-actions/actions/runs/26096017340)

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/26096017340)
>
> 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 26096017340 -n agent -D /tmp/agent-26096017340

# Fetch the bundle into a local branch
git fetch /tmp/agent-26096017340/aw-fix-1135-duplicate-with.bundle refs/heads/fix-1135-duplicate-with:refs/heads/fix-1135-duplicate-with-7b2cd8ee4fec3409
git checkout fix-1135-duplicate-with-7b2cd8ee4fec3409

# Push the branch to origin
git push origin fix-1135-duplicate-with-7b2cd8ee4fec3409

# Create the pull request
gh pr create --title 'Fix duplicate `with` guidance in generated dogfood triggers' --base main --head fix-1135-duplicate-with-7b2cd8ee4fec3409 --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.