Skip to content

Commit 4d14bd9

Browse files
authored
Update and fix stale repos action (#358)
Signed-off-by: Matej Feder <[email protected]>
1 parent ba7c2de commit 4d14bd9

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/stale-repos.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@
1616
name: stale repo identifier
1717
"on":
1818
workflow_dispatch:
19-
push:
20-
branches:
21-
- main
2219
schedule:
2320
- cron: "0 1 1 * *" # Runs monthly: at 01:00 UTC on the 1st day of every month
2421

25-
permissions:
26-
contents: read
27-
issues: write
28-
2922
jobs:
3023
build:
3124
name: Stale repo identifier
@@ -38,10 +31,10 @@ jobs:
3831
contents: read
3932

4033
steps:
41-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
4235

4336
- name: Run stale_repos tool
44-
uses: github/stale-repos@v2.1.3
37+
uses: github/stale-repos@v8.0.3
4538
env:
4639
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4740
ORGANIZATION: SovereignCloudStack
@@ -53,7 +46,7 @@ jobs:
5346
run: mv stale_repos.md stale_repos_${{ matrix.days }}.md
5447

5548
- name: Upload stale report artifact
56-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@v5
5750
with:
5851
name: stale_repos_report_${{ matrix.days }}
5952
path: stale_repos_${{ matrix.days }}.md
@@ -64,35 +57,41 @@ jobs:
6457
needs: build # Runs after all matrix jobs finish
6558

6659
permissions:
60+
contents: write
6761
issues: write
6862

6963
steps:
70-
- uses: actions/checkout@v4
64+
- uses: actions/checkout@v6
7165

7266
- name: Download all stale report artifacts
73-
uses: actions/download-artifact@v4
67+
uses: actions/download-artifact@v6
7468
with:
7569
path: stale_reports
7670

7771
- name: Merge reports
7872
run: |
79-
echo "# Stale Repository Report" > final_stale_repos.md
73+
echo "# Autogenerated Stale Repository Report " > final_stale_repos.md
74+
echo "### Do not close this issue - it is autogenerated by the `stale repo identifier` action" >> final_stale_repos.md
75+
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
8076
for file in stale_reports/**/stale_repos_*.md; do
8177
cat "$file" >> final_stale_repos.md
8278
echo "" >> final_stale_repos.md
8379
done
8480
8581
- name: Check for the stale report issue
8682
run: |
87-
ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number")
83+
ISSUE_NUMBER=$(gh search issues "Autogenerated Stale Repository Report (DO NOT CLOSE)" --match title --json number --jq ".[0].number")
8884
echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV"
8985
env:
9086
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9187

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

0 commit comments

Comments
 (0)