Closed leightjohnson93 closed 1 month ago
@leightjohnson93 this is because the GitHub Token cannot perform the environment deletion. It can only delete deployments. There is a comment in the code about that:
# This requires repository permission, which the GitHub Action token cannot get, so cannot delete the environment unfortunately
@crohr So I don't understand, what's the point of having ttl
if it doesn't work? I really just want to delete the instance so we aren't wasting money.
I think I meant to say instances and deployments instead.
Could we just like, remove the label after ttl?
@leightjohnson93 this is because the GitHub Token cannot perform the environment deletion. It can only delete deployments. There is a comment in the code about that:
# This requires repository permission, which the GitHub Action token cannot get, so cannot delete the environment unfortunately
What about the option to pass in our own github token with administrator permissions?
Could we add a new YAML option to attempt the deletion of the environment because we provided our own Github Token?
So:
There's already a YAML parameter github_token
to provide a custom token.
This actions has steps to get a suitable token: https://github.com/marketplace/actions/delete-deployment-environment
@crohr So I don't understand, what's the point of having
ttl
if it doesn't work? I really just want to delete the instance so we aren't wasting money.I think I meant to say instances and deployments instead.
Could we just like, remove the label after ttl?
Instances are destroyed with the TTL, but the GitHub environment object is not, since it requires permissions the GitHub context cannot have.
Could we add a new YAML option to attempt the deletion of the environment because we provided our own Github Token?
Yes, I will open a separate PR for that
The scheduled job doesn't seem to actually be cleaning up the expired ~environments~ instances. It just logs a message.
https://github.com/pullpreview/action/issues/83