Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/deployment trigger and keep parameters #33

Merged
merged 9 commits into from
Jan 19, 2023

Conversation

snorremd
Copy link
Contributor

@snorremd snorremd commented Jan 18, 2023

An improvement on @zaosoula's PR: #25.
The PR allows users of the GitHub action to delete deployments for any deployment trigger type, be it github:push or ad_hoc.

Additionally the action will now allow users to specify the number of deployments to keep. This input variable will default to 0 in which case we add the ?force=true parameter to the DELETE HTTP requests to Cloudflare. This allows deleting also the last deployment for a given branch/alias.

Because environment variables are used to test the action locally with correct input values each input name should be encodable as a POSIX compliant environment variable. I've therefore renamed deployment-trigger to deployment_trigger.

Credit to @zaosoula for the initial work on this. ❤️

By default delete all deployments. If keep is specified keep the
assigned number of deployments by slicing the filtered deployments list.

In order to test the action locally avoid using kebab case for input
name to allow POSIX compliant environment variables. I.e. use
deployment_trigger instead of deployment-trigger so we can write
INPUT_DEPLOYMENT_TRIGGER while testing or running in Docker.

Signed-off-by: Snorre Magnus Davøen <snorre.magnus.davoen@adventuretech.no>
@snorremd snorremd force-pushed the feat/deployment-trigger-and-keep-parameters branch from a4868bc to 604a392 Compare January 18, 2023 12:30
README.md Outdated Show resolved Hide resolved
Copy link

@ertkjern ertkjern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snorremd snorremd merged commit 33716c8 into main Jan 19, 2023
@snorremd snorremd deleted the feat/deployment-trigger-and-keep-parameters branch January 19, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants