aws-samples / aws-samples/sample-agent-assisted-sdlc
Fix agent-start workflow trigger: use @agent mention, drop dead comment context refs
- Dominant language
- Python
- Stars
- 42
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
The active workflow at `.github/workflows/agent-start.yml` only listens to `issues: [labeled]`, but its `if:` condition references `github.event.comment.*` and event names `issue_comment` / `pull_request_review_comment`. Since the `comment` object doesn't exist in the `issues` event payload, the Actions linter reports:
```
Context access might be invalid: comment
```
Those comment/PR-review branches are effectively dead code — they can never fire under the current `on:` triggers.
## Goal
Trigger the pipeline on an `@agent` mention (not the label), across:
- New/edited issues whose body contains `@agent`
- Issue comments containing `@agent`
- PR review comments containing `@agent`
## Fix
- Expand `on:` to include `issues: [opened, edited]`, `issue_comment: [created]`, and `pull_request_review_comment: [created]` so the referenced contexts actually exist.
- Keep the author-association / actor authorization gate.
- Remove the label dependency (the pipeline payload never consumed labels anyway).
The label is not required by the pipeline: the Step Functions payload is built purely from the issue GraphQL query and contains no labels. The `agent:start` Cedar policy only *forbids* the agent from setting the label (loop prevention), it does not gate invocation.
Contributor guide
Research direction
Start with .github/workflows/agent-start.yml and inspect its current on: triggers and if: condition. Run the GitHub Actions linter, then verify that opened or edited issues, issue comments, and pull request review comments containing @agent can pass the existing authorization gate without depending on labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100