Skip to content

Commit a050354

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

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/stale-repos.yml

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

0 commit comments

Comments
 (0)