https://github.com/ngduc/clean-up-action
Github Action to clean up resources.
https://github.com/ngduc/clean-up-action
Last synced: 9 months ago
JSON representation
Github Action to clean up resources.
- Host: GitHub
- URL: https://github.com/ngduc/clean-up-action
- Owner: ngduc
- License: mit
- Created: 2020-05-23T01:38:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T15:28:22.000Z (over 3 years ago)
- Last Synced: 2025-06-11T18:42:42.382Z (about 1 year ago)
- Language: JavaScript
- Size: 968 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```yml
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
- Marketplace link: [marketplace/actions/clean-up-resources](https://github.com/marketplace/actions/clean-up-resources)
- Article: [Github Action - Clean up resources](https://dev.to/ngduc/github-action-clean-up-resources-i70)
- Usage example: [parcelui](https://github.com/ngduc/parcelui/blob/master/.github/workflows/ci.yml#L39-L47)