Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run only on PRs? #1112

Open
alper opened this issue Nov 27, 2023 · 9 comments
Open

How to run only on PRs? #1112

alper opened this issue Nov 27, 2023 · 9 comments
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@alper
Copy link

alper commented Nov 27, 2023

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.

@alper alper added feature request New feature or request to improve the current logic needs triage labels Nov 27, 2023
@marko-zivic-93
Copy link
Contributor

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

@dsame dsame self-assigned this Nov 27, 2023
@dsame
Copy link
Contributor

dsame commented Nov 27, 2023

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
Copy link
Author

alper commented Nov 27, 2023

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
Copy link
Contributor

dsame commented Nov 28, 2023

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
Copy link

@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
Copy link

mosabua commented Dec 29, 2023

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
Copy link

joaopgrassi commented Feb 26, 2024

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
Copy link

Gustry commented Jun 19, 2024

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

bbhtt added a commit to flathub/flathub that referenced this issue Jun 28, 2024
Also increase the limit to wait for 30 days before closing

stale workflow has no option on running on issues only

See actions/stale#1112
@DjoykeAbyah
Copy link

DjoykeAbyah commented Jul 5, 2024

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

fpiesche pushed a commit to fpiesche/flathub that referenced this issue Sep 22, 2024
Also increase the limit to wait for 30 days before closing

stale workflow has no option on running on issues only

See actions/stale#1112
BuonHobo pushed a commit to BuonHobo/flathub that referenced this issue Sep 30, 2024
Also increase the limit to wait for 30 days before closing

stale workflow has no option on running on issues only

See actions/stale#1112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

8 participants