actions / stale

Marks issues and pull requests that have not had recent interaction
MIT License
1.34k stars 353 forks source link

How to run for other repos in the same organization #1128

Open sumire88 opened 8 months ago

sumire88 commented 8 months ago

Description:

Hi, I wonder how we may run this action for multiple repositories.

[!NOTE] I use GitHub App for OAuth, already granted the app permission to pull_request and issue

Justification:

My current setup is as follows:

name: Check stale status

on:
  schedule:
    - cron: "0 0 * * *" # UTC 00:00 every day

env:
  repositories: "automation-hub"
  days-before-stale: 14

jobs:
  checker:
    runs-on: ubuntu-latest
    steps:
      - name: Generate an installation token
        id: generate_token
        uses: actions/create-github-app-token@v1
        env:
          GITHUB_TOKEN: ${{ github.token }}
        with:
          app-id: ${{ secrets.STALE_BOT_APP_ID }}
          private-key: ${{ secrets.STALE_BOT_APP_PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
          repositories: ${{ env.repositories }}

      - uses: actions/stale@main
        with:
          repo-token: ${{ steps.generate_token.outputs.token }}
          stale-issue-message: "This issue is stale because it has been open ${{ env.days-before-stale }} days with no activity. Don't be panic, it will still be open until somebody explictly closes it."
          stale-pr-message: "This issue is stale because it has been open ${{ env.days-before-stale }} days with no activity. Don't be panic, it will still be open until somebody explictly closes it."
          stale-issue-label: stale
          stale-pr-label: stale
          exempt-pr-labels: "triage/accepted"
          exempt-issue-labels: "triage/awaiting-approval,triage/in-progress"
          exempt-all-issue-assignees: true
          days-before-stale: ${{ env.days-before-stale }}
          days-before-close: -1
          days-before-pr-close: -1
          start-date: "2024-01-01T00:00:00Z" # ISO 8601 or RFC 2822

The idea is to run this action for N repos based on a cron schedule.

Are you willing to submit a PR?

NA.

HarithaVattikuti commented 8 months ago

Hello @sumire88 Thank you for creating this feature request. We will investigate it and come back to you as soon as we have some feedback.

sumire88 commented 8 months ago

Hello @sumire88 Thank you for creating this feature request. We will investigate it and come back to you as soon as we have some feedback.

Thanks for the positive response. Appreciate it.

rocklan commented 5 months ago

Thank you for creating this feature request. We will investigate it and come back to you as soon as we have some feedback.

@HarithaVattikuti - any update on this?