generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Summary
The action fails with exit code 1 when attempting to link an app that is already linked, even though this is a valid use case for re-deployments (e.g., synchronize events on PRs).
Environment
- Action:
47ng/[email protected] - Context: GitHub Actions workflow for review apps
Steps to Reproduce
- Create a PR that triggers the review app workflow
- Workflow creates and links the app successfully
- Push a new commit to the PR (triggers
synchronizeevent) - Workflow re-runs and attempts to link the same app
- Fails with:
Application app_xxx is already linked with alias app_xxx
Error Log
[command]/action/node_modules/.bin/clever link app_24e00c72-7811-42a4-9fb2-e95928f2a3f6 --alias app_24e00c72-7811-42a4-9fb2-e95928f2a3f6
[ERROR] Application app_24e00c72-7811-42a4-9fb2-e95928f2a3f6 is already linked with alias app_24e00c72-7811-42a4-9fb2-e95928f2a3f6
##[error]The process '/action/node_modules/.bin/clever' failed with exit code 1
Expected Behavior
The action should handle the "already linked" case gracefully:
- Either skip linking if already linked
- Or unlink first, then re-link
Suggested Fix
In the action's entrypoint script, before calling clever link:
# Unlink any existing app first (ignore errors if not linked)
clever unlink --alias "$APP_ID" 2>/dev/null || true
# Then link
clever link "$APP_ID" --alias "$APP_ID"Or check if already linked:
if ! clever link "$APP_ID" --alias "$APP_ID" 2>&1 | grep -q "already linked"; then
# Handle actual errors
exit 1
fiWorkaround
Replace the action with direct CLI commands:
- name: Setup Clever CLI
run: npm install -g clever-tools
- name: Deploy Code to CleverCloud
run: |
clever login --token "$CLEVER_TOKEN" --secret "$CLEVER_SECRET"
clever unlink --alias "$APP_ID" 2>/dev/null || true
clever link "$APP_ID" --alias "$APP_ID"
clever deploy --force --alias "$APP_ID"Metadata
Metadata
Assignees
Labels
No labels