Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions docs/guides/user/building-custom-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ post_script: customized/scripts/post-my-agent.sh
runner_env:
MY_VAR: "${MY_VAR}"
ISSUE_KEY: "${ISSUE_KEY}"
REPO_FULL_NAME: "${REPO_FULL_NAME}"
GH_TOKEN: "${GH_TOKEN}"
FULLSEND_OUTPUT_SCHEMA: ${FULLSEND_DIR}/customized/schemas/my-agent-result.schema.json

Expand Down Expand Up @@ -263,17 +264,9 @@ set -euo pipefail
WORKSPACE="/tmp/workspace"
mkdir -p "$WORKSPACE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] correctness/pre-existing-gap

Pre-script example uses $REPO_FULL_NAME but this variable is not defined in the example harness runner_env or workflow env block. With set -euo pipefail the script would fail on the unset variable. Pre-existing issue (was in the elif branch before this PR), not introduced by this change. The customizing-agents.md guide shows the correct pattern: REPO_FULL_NAME: "${REPO_FULL_NAME}" in runner_env.

Suggested fix: Add REPO_FULL_NAME: "${REPO_FULL_NAME}" to the harness runner_env example and REPO_FULL_NAME: ${{ github.repository }} to the workflow env block in a follow-up PR.

if [[ "${ISSUE_SOURCE}" == "jira" ]]; then
AUTH=$(printf '%s:%s' "$JIRA_EMAIL" "$JIRA_API_TOKEN" | base64 -w0)
curl -sSf -H "Authorization: Basic $AUTH" \
"https://${JIRA_HOST}/rest/api/3/issue/${ISSUE_KEY}" \
> "$WORKSPACE/my-input.json"

elif [[ "${ISSUE_SOURCE}" == "github" ]]; then
gh issue view "$ISSUE_KEY" --repo "$REPO_FULL_NAME" \
--json number,title,body,labels,comments \
> "$WORKSPACE/my-input.json"
fi
gh issue view "$ISSUE_KEY" --repo "$REPO_FULL_NAME" \
--json number,title,body,labels,comments \
> "$WORKSPACE/my-input.json"

echo "Pre-script complete."
```
Expand Down Expand Up @@ -350,6 +343,7 @@ name: fullsend-my-agent
permissions:
contents: read
id-token: write
issues: write

on:
workflow_dispatch:
Expand All @@ -358,11 +352,6 @@ on:
description: 'Issue key'
required: true
type: string
issue_source:
description: 'Issue source: jira or github'
required: true
type: string
default: 'github'

concurrency:
group: my-agent-${{ inputs.issue_key || 'unknown' }}
Expand Down Expand Up @@ -429,7 +418,7 @@ jobs:
- name: Run my-agent
env:
ISSUE_KEY: ${{ inputs.issue_key }}
ISSUE_SOURCE: ${{ inputs.issue_source || 'github' }}
REPO_FULL_NAME: ${{ github.repository }}
MY_VAR: ABCD
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.FULLSEND_GCP_PROJECT_ID }}
Expand Down Expand Up @@ -468,8 +457,8 @@ jobs:

The workflow above uses `workflow_dispatch`, which means you trigger it manually:

- **From the GitHub UI:** Actions → fullsend-my-agent → Run workflow → fill in `issue_key` and `issue_source`.
- **From the CLI:** `gh workflow run my-agent.yml -f issue_key=123 -f issue_source=github`
- **From the GitHub UI:** Actions → fullsend-my-agent → Run workflow → fill in `issue_key`.
- **From the CLI:** `gh workflow run my-agent.yml -f issue_key=123`

### Slash-command dispatch (optional)

Expand Down Expand Up @@ -502,8 +491,7 @@ jobs:
run: |
gh workflow run my-agent.yml \
--repo "$REPO" \
-f issue_key="$ISSUE_NUMBER" \
-f issue_source="github"
-f issue_key="$ISSUE_NUMBER"

gh api "repos/${REPO}/issues/comments/${{ github.event.comment.id }}/reactions" \
-f content="rocket" --silent 2>/dev/null || true
Expand Down
Loading