So im trying to have qovery run for specific github pull requests. I use the CLI to run clone → app update → deploy which works fine,
but then if someone updates the PR the job fails due clone saying that an environment already exists with that name.
HOw do you deal with running the GHA mutiple times? (i put in a 'if: {{ !cabcekked()}} on the app update and deploy but it shows the job as failed still.
Hi @Stephen_Bennett , Could you share your GitHub Actions with me?
But basically, it’s up to you in that case to properly check actions that you are running if the Pull Request is updated. Maybe you could add a check if the environment XXX exists, then you update the apps you just redeploy the apps with the new changes.
If I got access to your GitHub Actions yaml, I can take a deeper look and propose a solution
# Execute the first command and capture its output
output=$(qovery environment list --json | jq -r '.[] | select(.name == "$BRANCH_NAME")')
# Check if the output is empty
if [ -z "$output" ]; then
# The output is empty, so clone the environment
qovery environment clone \
--organization "x" \
--project "x" \
--environment "entity-store" \
--new-environment-name "$BRANCH_NAME"
else
echo "Environment 'Toto' found, no need to clone."
fi
Then you make sure you don’t skip any potential errors while cloning.