Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit690e027

Browse files
committed
0 parents  commit690e027

File tree

8 files changed

+258
-0
lines changed

8 files changed

+258
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name:Bug report
3+
about:Create a report to help us improve
4+
title:''
5+
labels:''
6+
assignees:''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS:[e.g. iOS]
28+
- Browser[e.g. chrome, safari]
29+
- Version[e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device:[e.g. iPhone6]
33+
- OS:[e.g. iOS8.1]
34+
- Browser[e.g. stock browser, safari]
35+
- Version[e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name:Feature request
3+
about:Suggest an idea for this project
4+
title:''
5+
labels:''
6+
assignees:''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when[...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

‎.github/workflows/npm-publish.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name:Release Package
5+
6+
on:
7+
release:
8+
types:[created]
9+
10+
jobs:
11+
build:
12+
runs-on:ubuntu-latest
13+
steps:
14+
-uses:actions/checkout@v2
15+
-uses:actions/setup-node@v2
16+
with:
17+
node-version:14
18+
-run:npm install
19+
20+
publish-npm:
21+
needs:build
22+
runs-on:ubuntu-latest
23+
steps:
24+
-uses:actions/checkout@v2
25+
-uses:actions/setup-node@v2
26+
with:
27+
node-version:14
28+
registry-url:https://registry.npmjs.org/
29+
-run:npm publish
30+
env:
31+
NODE_AUTH_TOKEN:${{ secrets.NPM_TOKEN }}
32+
33+
publish-github:
34+
runs-on:ubuntu-latest
35+
steps:
36+
-uses:actions/checkout@v2
37+
-uses:actions/setup-node@v2
38+
with:
39+
registry-url:"https://npm.pkg.github.com"
40+
-name:scope package name as required by GHPR
41+
run:npm init -y --scope ${{ github.repository_owner }}
42+
-run:npm publish --ignore-scripts
43+
env:
44+
NODE_AUTH_TOKEN:${{ secrets.GITHUB_TOKEN }}

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 github.com/jv-k
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#▶️ Delete Workflow Runs
2+
3+
This npm module can be used to easily delete unneeded GitHub Workflow runs from your GitHub remote repository. You can select multiple entries to be deleted at once easily from a navigable list.
4+
5+
It uses the GitHub API, and requires gh (GitHub CLI) and jq (JSON processor)
6+
7+
##QuickStart
8+
9+
1. Install[GitHub CLI](https://github.com/cli/cli) and[jq](https://github.com/stedolan/jq), for example on`MacOS`:
10+
```sh
11+
$ brew install gh jq
12+
```
13+
14+
2. Install`delete-workflow-runs` globally:
15+
```shh
16+
$ npm i -g delete-workflow-runs
17+
```
18+
19+
3. Navigate to the directoy of the repository that you wish to delete workflow runs from,then run:
20+
```sh
21+
$ delete-workflow-runs
22+
```
23+
4. Use the`<up>` and`<down>` keys to navigate the list of workflow runs, andselectthe ones to be deleted with`<tab>`.
24+
25+
5. Press`<enter>` to delete the runs from your GitHub remote.
26+
27+

‎delete-workflow-runs.sh‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
3+
# Name: Delete Workflow Runs
4+
# Author: "John Valai <git@jvk.to>"
5+
# License": "MIT"
6+
7+
# This npm module can be used to easily delete unneeded GitHub Workflow runs
8+
# from your GitHub remote repository. You can select multiple entries to be
9+
# deleted at once easily from a navigable list.
10+
11+
# make script exit when a command fails:
12+
set -o errexit
13+
# if any element of the pipeline fails, then the pipeline as a whole will fail:
14+
set -o pipefail
15+
16+
# Use supplied repo name, otherwise grab from current repo folder
17+
get_repo_name() {
18+
["$#"-eq 0 ]&& repo=$(git remote show origin -n| grep h.URL| sed's/.*://;s/.git$//')|| repo=$1
19+
}
20+
21+
jqscript() {
22+
cat<<EOF
23+
def symbol:
24+
sub("skipped"; "SKIP") |
25+
sub("success"; "GOOD") |
26+
sub("failure"; "FAIL");
27+
def tz:
28+
gsub("[TZ]"; " ");
29+
.workflow_runs[]
30+
| [
31+
(.conclusion | symbol),
32+
(.created_at | tz),
33+
.id,
34+
.event,
35+
.name
36+
]
37+
| @tsv
38+
EOF
39+
}
40+
41+
select_runs() {
42+
gh api --paginate"/repos/$repo/actions/runs" \
43+
| jq -r -f<(jqscript) \
44+
| fzf --multi
45+
}
46+
47+
delete_run() {
48+
local run id result
49+
run=$1
50+
id="$(cut -f 3<<<"$run")"
51+
gh api -X DELETE"/repos/$repo/actions/runs/$id" --silent \
52+
&& result="Deleted ✅" \
53+
|| result="Failed! ❌"
54+
printf"%s\t%s\n""$result""$run"
55+
}
56+
57+
delete_runs() {
58+
local id
59+
whileread -r run;do
60+
delete_run"$run"
61+
sleep 0.25
62+
done
63+
}
64+
65+
main() {
66+
get_repo_name$1
67+
select_runs| delete_runs
68+
}
69+
70+
main"$@"

‎package-lock.json‎

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name":"delete-workflow-runs",
3+
"version":"0.1.0",
4+
"description":"",
5+
"bin":"./delete-workflow-runs.sh",
6+
"homepage":"https://github.com/jv-k/delete-workflow-runs",
7+
"repository": {
8+
"type":"git",
9+
"url":"https://github.com/jv-k/delete-workflow-runs.git"
10+
},
11+
"author":"John Valai <git@jvk.to>",
12+
"license":"MIT",
13+
"keywords": [
14+
"workflows",
15+
"workflow-runs",
16+
"delete-workflow-runs",
17+
"github.api"
18+
],
19+
"scripts": {
20+
"test":"echo\"Error: no test specified\" && exit 1"
21+
}
22+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp