Skip to content

Commit 7d22baf

Browse files
committed
Update and fix stale repos action
Signed-off-by: Matej Feder <[email protected]>
1 parent ba7c2de commit 7d22baf

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/stale-repos.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ name: stale repo identifier
1818
workflow_dispatch:
1919
push:
2020
branches:
21-
- main
21+
- fix-stale-repos-action
2222
schedule:
2323
- cron: "0 1 1 * *" # Runs monthly: at 01:00 UTC on the 1st day of every month
2424

25-
permissions:
26-
contents: read
27-
issues: write
28-
2925
jobs:
3026
build:
3127
name: Stale repo identifier
@@ -38,10 +34,10 @@ jobs:
3834
contents: read
3935

4036
steps:
41-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v6
4238

4339
- name: Run stale_repos tool
44-
uses: github/stale-repos@v2.1.3
40+
uses: github/stale-repos@v8.0.3
4541
env:
4642
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4743
ORGANIZATION: SovereignCloudStack
@@ -53,7 +49,7 @@ jobs:
5349
run: mv stale_repos.md stale_repos_${{ matrix.days }}.md
5450

5551
- name: Upload stale report artifact
56-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@v5
5753
with:
5854
name: stale_repos_report_${{ matrix.days }}
5955
path: stale_repos_${{ matrix.days }}.md
@@ -64,35 +60,41 @@ jobs:
6460
needs: build # Runs after all matrix jobs finish
6561

6662
permissions:
63+
contents: write
6764
issues: write
6865

6966
steps:
70-
- uses: actions/checkout@v4
67+
- uses: actions/checkout@v6
7168

7269
- name: Download all stale report artifacts
73-
uses: actions/download-artifact@v4
70+
uses: actions/download-artifact@v6
7471
with:
7572
path: stale_reports
7673

7774
- name: Merge reports
7875
run: |
79-
echo "# Stale Repository Report" > final_stale_repos.md
76+
echo "# Autogenerated Stale Repository Report " > final_stale_repos.md
77+
echo "### Do not close this issue - it is autogenerated by the `stale repo identifier` action" >> final_stale_repos.md
78+
echo "### Two thresholds are used - **335** days and **365** days — in accordance with the standard: https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0006-v1-organization-management.md" >> final_stale_repos.md
8079
for file in stale_reports/**/stale_repos_*.md; do
8180
cat "$file" >> final_stale_repos.md
8281
echo "" >> final_stale_repos.md
8382
done
8483
8584
- name: Check for the stale report issue
8685
run: |
87-
ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number")
86+
ISSUE_NUMBER=$(gh search issues "Autogenerated Stale Repository Report (DO NOT CLOSE)" --match title --json number --jq ".[0].number")
8887
echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV"
8988
env:
9089
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9190

9291
- name: Create or update issue
93-
uses: peter-evans/create-issue-from-file@v5
92+
uses: peter-evans/create-issue-from-file@v6
9493
with:
9594
issue-number: ${{ env.issue_number }}
96-
title: Stale repository report
95+
title: Autogenerated Stale Repository Report (DO NOT CLOSE)
9796
content-filepath: ./final_stale_repos.md
98-
token: ${{ secrets.GITHUB_TOKEN }}
97+
# FIXME: GITHUB_TOKEN does not work on forks (including this repo).
98+
# See: https://github.com/peter-evans/create-issue-from-file/issues/1673
99+
# Remove the current PAT workaround and implement a better solution.
100+
token: ${{ secrets.STALE_PAT }}

0 commit comments

Comments
 (0)