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

add action for prune-github-workflow-runs #9

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Dependency directory
node_modules

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

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

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

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# 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
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# OS metadata
.DS_Store
Thumbs.db

# Ignore built ts files
__tests__/runner/*

# IDE files
.idea
.vscode
*.code-workspace
4 changes: 4 additions & 0 deletions prune-github-workflow-runs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib/
dist/
node_modules/
coverage/
1 change: 1 addition & 0 deletions prune-github-workflow-runs/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.6.0
3 changes: 3 additions & 0 deletions prune-github-workflow-runs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
coverage/
19 changes: 19 additions & 0 deletions prune-github-workflow-runs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Description

Delete obsolete runs of workflows that do not exist anymore in the given repo.

## Inputs

| parameter | description | required | default |
| --- | --- | --- | --- |
| token | GitHub access token | `true` | |
| owner | Repository owner | `false` | ${{ github.repository_owner }} |
| repo | Repository name | `false` | ${{ github.event.repository.name }} |
| dry-run | Do not delete runs, just print them | `false` | false |


## Runs

This action is a `node20` action.


22 changes: 22 additions & 0 deletions prune-github-workflow-runs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Prune Github Workflow Runs"
description: "Delete obsolete runs of workflows that do not exist anymore in the given repo."

inputs:
token:
description: GitHub access token
required: true
owner:
description: Repository owner
required: false
default: ${{ github.repository_owner }}
repo:
description: Repository name
required: false
default: ${{ github.event.repository.name }}
dry-run:
description: "Do not delete runs, just print them"
required: false
default: "false"
runs:
using: node20
main: "dist/index.js"
Loading