pullpreview / action

A GitHub Action that starts preview deployments for your pull requests and branches. It can work with any application that has a valid Docker Compose file.
https://pullpreview.com
Other
161 stars 13 forks source link

TTL not working as expected #83

Closed Wardormeur closed 1 week ago

Wardormeur commented 1 month ago

Hello :) We've been trying some cost optimisation, and the TTL seemed like a good usage for it We applied it as follow: Screenshot 2024-07-12 at 15 35 19

However, despite checking after the deadline of 4h, the instance was still up Did I misunderstand the role of the TTL? Does it need a "trigger" to start the countdown? Cheers,

cc @reaper

crohr commented 1 month ago

@Wardormeur do you have the schedule trigger in your workflow file? e.g.

on:
  schedule:
    - cron: "30 2 * * *"
leightjohnson93 commented 1 month ago

@crohr The scheduled jobs in this repo say they are clearing the same envs each time they run https://github.com/pullpreview/action/actions/runs/9978134107/job/27574337981#step:3:107

crohr commented 1 week ago

Environment cleanup has been re-enabled. By default this will do nothing since the default action token doesn't have enough permissions to clear the environment object on GitHub, but you should be able to pass a custom token with the github_token input, and then the operation should be successful. Would be great if you could test pullpreview/action@master and report whether it works for you!