Skip to content

Commit

Permalink
Merge pull request #34 from 10up/update/stale-repos-action
Browse files Browse the repository at this point in the history
Update/stale repos action
  • Loading branch information
jeffpaul authored Feb 22, 2024
2 parents db76cfa + fd1f52c commit 4f00ea9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/stale_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run stale_repos tool
uses: github/stale-repos@v1
env:
GH_TOKEN: ${{ secrets.GH_PAT_REPO }}
GH_TOKEN: ${{ secrets.GH_TOKEN_READ_PUBLIC_REPOS }}
ORGANIZATION: 10up
EXEMPT_TOPICS: "keep,template"
INACTIVE_DAYS: 365
ACTIVITY_METHOD: "default_branch_updated"

# 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.
- name: Check for the stale report issue
run: |
ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number")
echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create issue
uses: peter-evans/create-issue-from-file@v4
- name: Create issue from STALE_REPOS.md
uses: peter-evans/create-issue-from-file@v5
with:
issue-number: ${{ env.issue_number }}
title: Stale repository report
content-filepath: ./STALE_REPOS.md
assignees: jeffpaul
token: ${{ secrets.GH_PAT_REPO }}
token: ${{ secrets.GITHUB_TOKEN }}

7 changes: 7 additions & 0 deletions STALE_REPOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Inactive Repositories

The following repos have not had a push event for more than 365 days:

| Repository URL | Days Inactive | Last Push Date |
| --- | ---: | ---: |
| https://github.com/github/.github | 5 | 2020-1-30 |

0 comments on commit 4f00ea9

Please sign in to comment.