Skip to content

ngduc/clean-up-action

Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

javscript-action status

Clean-up-action

Use this Github Action to clean up resources after X minutes by calling a URL (GET/POST)

Use cases

  • After deploying to a demo environment, 1 day later, we want it to clean up itself by triggering an API endpoint to remove that demo environment.
  • After running some steps, we want to trigger an endpoint to notify somebody, etc.

Usage

Add to your Yaml file:

jobs:
  clean:
    runs-on: ubuntu-latest
    steps:
      - name: cleanup
        uses: ngduc/clean-up-action@master
        with:
          projectId: setYourProjectId # set your unique projectId, example: myProjectId1
          expiryMins: 1440 # after X minutes, invoke the below URL endpoint.
          method: 'POST' # one of these methods: GET, POST, PUT, PATCH, DELETE
          url: https://some.cleanup.api.endpoint # some URL endpoint to clean up resources.
          headers: '' # headers (JSON string).
          payload: '{ "someResourceId": 1234 }' # payload for url (JSON string).

How It Works

  • The cleanup action is scheduled to run in X minutes.
  • There is a cronjob to check it continously. After X minutes, it will trigger your URL endpoint with parameters to clean up resources (or do something else).

Links

About

Github Action to clean up resources.

Resources

License

Stars

Watchers

Forks

Packages

No packages published