Skip to content

Commit 91c2a3f

Browse files
committed
Add stale repos action
Signed-off-by: Matej Feder <[email protected]>
1 parent 385d5e3 commit 91c2a3f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/stale-repos.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: stale repo identifier
3+
4+
"on":
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
- get_stale # Only for tests
10+
schedule:
11+
- cron: "3 2 1 * *"
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
name: stale repo identifier
19+
runs-on: ubuntu-latest
20+
21+
permissions:
22+
contents: read
23+
issues: write
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Run stale_repos tool
29+
uses: github/[email protected]
30+
env:
31+
GH_TOKEN: ${{ secrets.GHP_MFEDER }}
32+
ORGANIZATION: SovereignCloudStack
33+
INACTIVE_DAYS: 365
34+
ACTIVITY_METHOD: "pushed"
35+
ADDITIONAL_METRICS: "release,pr"
36+
37+
# This next step updates an existing issue. If you want a new issue every time, remove this step and remove the `issue-number: ${{ env.issue_number }}` line below.
38+
- name: Check for the stale report issue
39+
run: |
40+
ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number")
41+
echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV"
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Create issue
46+
uses: peter-evans/create-issue-from-file@v5
47+
with:
48+
issue-number: ${{ env.issue_number }}
49+
title: Stale repository report
50+
content-filepath: ./stale_repos.md
51+
labels: |
52+
report

0 commit comments

Comments
 (0)