Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions .github/workflows/ai-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ jobs:
- name: Run the agent runner
env:
GH_TOKEN: ${{ steps.mint.outputs.token }}
GITHUB_REPOSITORY: ${{ inputs.repo }}
# GITHUB_REPOSITORY is reserved and cannot be overridden by env:;
# the runner reads AI_TARGET_REPO first.
AI_TARGET_REPO: ${{ inputs.repo }}
ISSUE_NUMBER: ${{ inputs.issue }}
WORK_DIR: ${{ env.WORK_DIR }}
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}
Expand Down Expand Up @@ -117,7 +119,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v7
with:
name: ai-run-${{ inputs.repo }}-${{ inputs.issue }}
name: ai-run-${{ inputs.issue }}-${{ github.run_id }}
path: ${{ runner.temp }}/ai-issue-${{ inputs.issue }}
if-no-files-found: ignore
retention-days: 7
4 changes: 3 additions & 1 deletion agent-runner/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ function riskLine(risk: RiskAssessment | null): string {
}

async function main(): Promise<void> {
const repo = requireEnv("GITHUB_REPOSITORY");
// `AI_TARGET_REPO` is for workflows that cannot override the reserved
// GITHUB_REPOSITORY variable (ai-run.yml runs one task for a foreign repo).
const repo = process.env.AI_TARGET_REPO?.trim() || requireEnv("GITHUB_REPOSITORY");
const issueNumber = Number(requireEnv("ISSUE_NUMBER"));
if (!Number.isInteger(issueNumber) || issueNumber <= 0) throw new Error(`Bad ISSUE_NUMBER: ${process.env.ISSUE_NUMBER}`);

Expand Down
Loading