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
1 change: 1 addition & 0 deletions .github/scripts/keepalive_loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ async function evaluateKeepaliveLoop({ github, context, core }) {

return {
prNumber,
prRef: pr.head.ref || '',
action,
reason,
gateConclusion,
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/agents-keepalive-loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
environment: agent-standard
outputs:
pr_number: ${{ steps.evaluate.outputs.pr_number }}
pr_ref: ${{ steps.evaluate.outputs.pr_ref }}
action: ${{ steps.evaluate.outputs.action }}
reason: ${{ steps.evaluate.outputs.reason }}
gate_conclusion: ${{ steps.evaluate.outputs.gate_conclusion }}
Expand Down Expand Up @@ -103,6 +104,7 @@ jobs:
const result = await evaluateKeepaliveLoop({ github, context, core });
const output = {
pr_number: String(result.prNumber || ''),
pr_ref: String(result.prRef || ''),
action: result.action || '',
reason: result.reason || '',
gate_conclusion: result.gateConclusion || '',
Expand Down Expand Up @@ -169,6 +171,7 @@ jobs:
prompt_file: .github/codex/prompts/keepalive_next_task.md
mode: keepalive
pr_number: ${{ needs.evaluate.outputs.pr_number }}
pr_ref: ${{ needs.evaluate.outputs.pr_ref }}

summary:
name: Update keepalive summary
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/reusable-codex-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
required: false
default: ''
type: string
pr_ref:
description: 'The branch/ref to checkout and push to (e.g., refs/heads/feature-branch).'
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The description states that the expected format is refs/heads/feature-branch, but the actual value being passed from the JavaScript code is just the branch name without the refs/heads/ prefix. While the checkout action can handle both formats, the description should be updated to reflect the actual format being used for clarity and accuracy. Consider updating the example to just feature-branch to match the implementation.

Suggested change
description: 'The branch/ref to checkout and push to (e.g., refs/heads/feature-branch).'
description: 'The branch to checkout and push to (e.g., feature-branch).'

Copilot uses AI. Check for mistakes.
required: false
default: ''
type: string
max_runtime_minutes:
description: 'Upper bound for the job runtime in minutes.'
required: false
Expand Down Expand Up @@ -138,6 +143,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.pr_ref || github.ref }}
token: ${{ steps.auth_token.outputs.checkout_token }}

- name: Set up Python
Expand Down Expand Up @@ -308,13 +314,20 @@ jobs:
env:
MODE: ${{ inputs.mode }}
PR_NUMBER: ${{ inputs.pr_number }}
PR_REF: ${{ inputs.pr_ref }}
PUSH_ALLOWED: ${{ steps.auth_token.outputs.push_allowed }}
PUSH_TOKEN: ${{ steps.auth_token.outputs.push_token }}
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

# Determine the target branch
TARGET_REF="${PR_REF:-${{ github.ref_name }}}"
# Strip refs/heads/ prefix if present
TARGET_BRANCH="${TARGET_REF#refs/heads/}"
echo "Target branch: ${TARGET_BRANCH}"

# Count changed files
CHANGED_FILES=$(git status --porcelain | wc -l)
echo "files-changed=${CHANGED_FILES}" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -347,7 +360,7 @@ jobs:
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit-sha=${COMMIT_SHA}" >> "$GITHUB_OUTPUT"

git push "https://x-access-token:${PUSH_TOKEN}@github.com/${{ github.repository }}" "HEAD:${{ github.ref_name }}"
git push "https://x-access-token:${PUSH_TOKEN}@github.com/${{ github.repository }}" "HEAD:${TARGET_BRANCH}"

echo "::notice::Pushed commit ${COMMIT_SHA} with ${CHANGED_FILES} file(s) changed"

Expand Down
Loading