Skip to content

fix: stop referencing secrets directly in a step if: condition - #103

Merged
Santisoutoo merged 1 commit into
mainfrom
fix/cursor-cli-if-secrets
Aug 24, 2026
Merged

fix: stop referencing secrets directly in a step if: condition#103
Santisoutoo merged 1 commit into
mainfrom
fix/cursor-cli-if-secrets

Conversation

@Santisoutoo

Copy link
Copy Markdown
Owner

Descripción

PR #101 cambió el if: del paso "Install Cursor CLI" a:

if: steps.pick.outputs.empty == 'false' && secrets.CURSOR_API_KEY != ''

Al intentar re-lanzar el agent-loop sobre el issue #85 (para probar el fix de timeout de #102), gh workflow run devolvió:

HTTP 422: Invalid Argument - failed to parse workflow: (Line: 138, Col: 13):
Unrecognized named-value: 'secrets'. Located at position 40 within expression:
steps.pick.outputs.empty == 'false' && secrets.CURSOR_API_KEY != ''

GitHub rechaza referenciar secrets directamente en el if: de un step. Esto no es solo un problema de workflow_dispatch manual — rompe el fichero de workflow entero, así que también habría bloqueado el próximo cron (06/13/20 UTC).

En el resto del fichero, cada acceso a un secret pasa por env: (el patrón permitido); esta era la única línea que lo hacía directamente en un if:.

Cambio

  • pick-issue.sh ya calcula CURSOR_AVAILABLE a partir del secret dentro de su propio env: (patrón seguro). Lo expone ahora como output cursor_available=true|false.
  • agent-loop.yml gatea "Install Cursor CLI" con steps.pick.outputs.cursor_available == 'true' en vez de secrets.CURSOR_API_KEY != ''.

Mismo comportamiento pretendido (instalar el CLI de Cursor siempre que el secret esté configurado, no solo cuando el worker enruta a Cursor), sin tocar secrets desde un if:.

Checklist

  • bash -n en ambos scripts modificados
  • Verificado que es la única ocurrencia de secrets\. dentro de un if: en .github/workflows/*.yml
  • Sin cambios de superficie de permisos/secretos

closes ninguno — bug de infra descubierto durante el testing manual de #102, no ligado a un issue de producto.

PR #101 changed the "Install Cursor CLI" step's `if:` to
`secrets.CURSOR_API_KEY != ''`. GitHub rejects that at workflow_dispatch
validation time with "Unrecognized named-value: 'secrets'" (HTTP 422),
hit for real trying to re-dispatch issue #85 after merging the
run-engine.sh timeout fix. This silently broke every future trigger of
agent-loop.yml, including the 06/13/20 UTC cron.

pick-issue.sh already computes CURSOR_AVAILABLE from the secret inside
its own env (the allowed pattern — secrets flow through env:, never
directly in if:). Expose it as a step output (cursor_available) and gate
the Cursor CLI install on that instead.
@Santisoutoo
Santisoutoo enabled auto-merge August 24, 2026 18:32
@github-actions github-actions Bot added the area: ci-cd GitHub Actions / workflows / dependabot label Aug 24, 2026
@Santisoutoo
Santisoutoo merged commit c4a0369 into main Aug 24, 2026
15 checks passed
@Santisoutoo
Santisoutoo deleted the fix/cursor-cli-if-secrets branch August 24, 2026 18:32
Santisoutoo added a commit that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd GitHub Actions / workflows / dependabot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant