Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Brend Smits <[email protected]>
  • Loading branch information
Brend-Smits committed Jan 5, 2022
0 parents commit 12178f9
Show file tree
Hide file tree
Showing 11 changed files with 7,504 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/tmp
/out-tsc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# IDEs and editors
.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
.sass-cache
connect.lock
typings

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*


# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Lerna
lerna-debug.log

# System Files
.DS_Store
Thumbs.db
7 changes: 7 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# they will be requested for review when someone opens a
# pull request.
* @Brend-Smits @JeroenKnoops

# See CODEOWNERS syntax here: https://help.github.com/articles/about-codeowners/#codeowners-syntax
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Contributing
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
We accept all contributions. Please make sure to create an issue or discussion to let us know that you are working on a feature. If there is already an issue for your enhancement, please comment on it.

If you have a suggestion that would make this project better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement".

- Fork the Project
- Create your Feature Branch (git checkout -b feature/23-AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/23-AmazingFeature)
- Open a Pull Request

### Git Commit Messages
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Royal Philips

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
113 changes: 113 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<div align="center">

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

</div>

<br />
<div align="center">
<h3 align="center">GitHub Action to delete workflow artifact(s)</h3>

<p align="center">
An action that deletes an artifact associated with given workflow.
<br>
<a href="https://github.com/philips-labs/action-delete-artifacts/issues">Report Bug</a>
·
<a href="https://github.com/philips-labs/action-delete-artifacts/issues">Request Feature</a>
</p>
</div>

## Description

Let's suppose you have a workflow with a job in it that at the end uploads an artifact using `actions/upload-artifact` action and you want to download this artifact in another workflow using [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact). After downloading the artifact and doing something with the artifact (like deploying something to GitHub Pages), you may want to clean up the workflow artifact to stay within storage cost restrictions. This GitHub Actions helps with that.

## Usage

```YAML
cleanup-artifacts:
name: Job to clean up old artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Remove artifact
uses: philips-labs/[email protected]
with:
# Optional, GitHub token, a Personal Access Token with `repo` scope if needed
# Required, if artifact is from a different repo
# Required, if repo is private a Personal Access Token with `repo` scope is needed
github_token: ${{secrets.GITHUB_TOKEN}}
# Required, workflow file name or ID
workflow: workflow-name.yml
# Optional, uploaded artifact name,
# will delete all artifacts if not specified
name: artifact.json
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Default is set to success
workflow_conclusion: success
```
## Example
```YAML
name: Deploy Portal

on:
workflow_run:
branches:
- main
workflows: ["Deployment"]
types:
- completed
workflow_dispatch:

jobs:
cleanup-artifacts:
name: Job to clean up old artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Download artifact
uses: philips-labs/[email protected]
with:
workflow: crawl.yml
name: repos.json
```
## Contributing
If you have a suggestion that would make this project better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement".
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See [LICENSE](/LICENSE) for more information.

## Acknowledgments

This project is inspired by:

- [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)

[contributors-shield]: https://img.shields.io/github/contributors/philips-labs/action-delete-artifacts.svg?style=for-the-badge
[contributors-url]: https://github.com/philips-labs/action-delete-artifacts/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/philips-labs/action-delete-artifacts.svg?style=for-the-badge
[forks-url]: https://github.com/philips-labs/action-delete-artifacts/network/members
[stars-shield]: https://img.shields.io/github/stars/philips-labs/action-delete-artifacts.svg?style=for-the-badge
[stars-url]: https://github.com/philips-labs/action-delete-artifacts/stargazers
[issues-shield]: https://img.shields.io/github/issues/philips-labs/action-delete-artifacts.svg?style=for-the-badge
[issues-url]: https://github.com/philips-labs/action-delete-artifacts/issues
[license-shield]: https://img.shields.io/github/license/philips-labs/action-delete-artifacts.svg?style=for-the-badge
[license-url]: https://github.com/philips-labs/action-delete-artifacts/blob/main/LICENSE
31 changes: 31 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Delete workflow artifact
description: Delete an artifact associated with given workflow and commit
author: dawidd6, Brend-Smits
branding:
icon: delete
color: gray-dark
inputs:
github_token:
description: GitHub token
required: false
default: ${{github.token}}
workflow:
description: Workflow name
required: true
workflow_conclusion:
description: |
Wanted status or conclusion to search for in recent runs
https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-workflow-runs
required: false
default: success
repo:
description: Repository name with owner (like actions/checkout)
required: false
default: ${{github.repository}}
name:
description: Artifact name (delete all artifacts in not specified)
required: false
runs:
using: node12
main: dist/index.js
Loading

0 comments on commit 12178f9

Please sign in to comment.