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 only on PRs? #1112

Open alper opened 9 months ago

alper commented 9 months ago

I would like stale to run only on PRs but not on issues. I don't see a way in the documentation to do so.

marko-zivic-93 commented 9 months ago

Hello @alper Thank you for filing your issue. We will take a look and come back to you as soon as possible.

dsame commented 9 months ago

Hello alper, most of the operations have -pr- variant - they affect only PR's according to the documentation. Can you please clarify what namely operation do you want to be applied?

alper commented 9 months ago

I couldn't figure out how to not have it work on issues so I set the issue days to 999.

That should probably work long enough for my purposes.

dsame commented 9 months ago

Hello @alper , the provided info is not enough to identify the exact problem, but generally you should use only -pr- and do not use -issue- variants of the configuration option in order to process only PRs.

Did it help?

shmishra99 commented 8 months ago

@alper To opt out of the stale issue management for all issues, configure days-before-issue-stale and day-before-issue-closed` with a value of -1.

mosabua commented 8 months ago

I am trying this out @shmishra99 .. I think it would be great to have this in the docs .. you want me to send a PR to add it once I confirmed it works?

days-before-issue-stale: -1
day-before-issue-closed: -1

I assume the same approach works for excluding PRs:

days-before-pr-stale: -1
day-before-pr-closed: -1
joaopgrassi commented 6 months ago

Hello alper, most of the operations have -pr- variant - they affect only PR's according to the documentation. Can you please clarify what namely operation do you want to be applied?

This does not work. I have set up only the *-pr variant of configuration, but the bot still runs on issues because it there are defaults for days-before-stale: 60 and days-before-close: 7.

You can see this in this example Action run: https://github.com/open-telemetry/semantic-conventions/actions/runs/7925571995/job/21638954263

Run actions/stale@v9
  with:
    repo-token: ***
    stale-pr-message: This PR was marked stale due to lack of activity. It will be closed in 7 days.
    close-pr-message: Closed as inactive. Feel free to reopen if this PR is still being worked on.
    exempt-pr-labels: bug,work in progress,experts needed
    exempt-draft-pr: true
    days-before-pr-stale: 15
    days-before-pr-close: 7
    days-before-stale: 60 <<<<<<<<<<<<<<<<<< I did not add this in my config
    days-before-close: 7 <<<<<<<<<<<<<<<<<< I did not add this in my config
    stale-issue-label: Stale
    close-issue-reason: not_planned
    stale-pr-label: Stale
    exempt-all-milestones: false
    operations-per-run: 30
    remove-stale-when-updated: true
    debug-only: false
    ascending: false
    delete-branch: false
    exempt-all-assignees: false
    enable-statistics: true
    ignore-updates: false
    include-only-assigned: false

My current config is:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v9
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          stale-pr-message: 'This PR was marked stale due to lack of activity. It will be closed in 7 days.'
          close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
          exempt-pr-labels: 'bug,work in progress,experts needed'
          exempt-draft-pr: true
          days-before-pr-stale: 15
          days-before-pr-close: 7
Gustry commented 2 months ago

It seems I can confirm the behavior just above. I used only the *-pr-* configuration, but reading the logs, it's also checking issues :

[#4349] Issue #4349
  [#4349] Found this issue last updated at: 2024-05-21T08:26:23Z
....
 Processed items: 40
├── Processed issues: 31
└── Processed PRs   : 9
DjoykeAbyah commented 2 months ago

Hi @dsame!

I'm experiencing the same issue but the other way around. I've tried to override with a 'do not stale' label but it ignores it. I also tried setting up only the -issues variant of configuration and it does not work, also for setting the -pr to -1. Could an if statement maybe solve this issue?

regards,

Djoyke