-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (38 loc) · 1.21 KB
/
Copy pathsolved-issues.yml
File metadata and controls
45 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Count Solved Issues
on:
schedule:
- cron: '0 * * * *' # Runs every hour
workflow_dispatch:
jobs:
count:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Count closed issues labeled "Solved"
uses: actions/github-script@v6
with:
script: |
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
labels: "Solved",
state: "closed",
per_page: 100
});
const count = issues.length;
const fs = require('fs');
const badgeData = {
schemaVersion: 1,
label: "Solved Issues",
message: `${count}`,
color: "4CD66A"
};
fs.writeFileSync("solved-issues-badge.json", JSON.stringify(badgeData));
- name: Commit badge data
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add solved-issues-badge.json
git commit -m "Update Solved Issues badge"
git push