stale icon indicating copy to clipboard operation
stale copied to clipboard

Last updated date appears to be incorrect

Open michaelmior opened this issue 1 year ago • 5 comments

Description: As the excerpt from the log below shows, I have a pull request that is identified as having been updated within the past several days even though the last update I can see is nearly one year ago.

[#514] Pull request #514
  [#514] Found this pull request last updated at: 2024-10-15T01:53:46Z

Action version: v9

Platform:

  • [x] Ubuntu
  • [x] macOS
  • [ ] Windows

Runner type:

  • [x] Hosted
  • [ ] Self-hosted

Repro steps:
I am unsure how to reproduce this issue with a fresh repository, but here is an example of a run of this action that exhibits the problem. For example, look at pull request 512. It has not been updated in more than a year, but the action seems to think it was updated within the past several days.

Expected behavior: The correct date of the last update should be identified.

Actual behavior: The date of last update is not identified correctly.

michaelmior avatar Oct 17 '24 15:10 michaelmior

I do see the updated_at date returned by the API is within the past several days, so I assume this is the root of the issue, but I don't see any user-facing updates visible. No commits pushed on the corresponding branch, no comments, no labels changed, etc.

michaelmior avatar Oct 17 '24 15:10 michaelmior

Hello @michaelmior 👋, Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

HarithaVattikuti avatar Oct 18 '24 15:10 HarithaVattikuti

Yep, running into this with a bunch of stale PRs on my repo too. For some reason a bunch of them got unmarked as stale 3 days ago. (Appears this may be to do with the base branch getting force-pushed???)

dktapps avatar Dec 16 '24 20:12 dktapps

I am noticing this in our repos as well. Taking three example PRs for example, they each have a comment from the Stale Github action that they were quickly marked and unmarked as stale on 1/6/25. Neither PR has user activity on that day (they are automated dependabot type PRs), and all should be stale in that they are older than our configured threshhold for staleness.

image

When I look in the Github action logs, I can see the action processed these PRs consecutively in the same batch, and they have very similar updated at messages:

PR 1 -- Found this pull request last updated at: 2025-01-06T22:22:13Z PR 2 -- Found this pull request last updated at: 2025-01-06T22:22:13Z PR 3 -- Found this pull request last updated at: 2025-01-06T22:22:14Z

Adam262Alloy avatar Jan 08 '25 21:01 Adam262Alloy

Yeah, same thing when I tried on my repo. I think that the act of adding the Stale tag updates the updated_at. Github must've changed this internally, but this definitely breaks the logic. The first pass through it adds the tag, then the second pass it removes it.

wandbjake avatar Jan 23 '25 22:01 wandbjake

Yes, can confirm, the same finding here: the action adds the label Stale at the first run, then the second run removes the label again, despite there was no change at all at the PR:

Image

Image

mala-sap avatar May 13 '25 07:05 mala-sap

Hi @chiranjib-swain , any updates on this? We are constantly toggling PRs from being stale to un-stale and vice versa. By this we get flooded now by stale PRs caught in this endless loop: Image

mala-sap avatar Sep 10 '25 11:09 mala-sap

Hi @mala-sap, thanks for sharing these findings .

Image

Image 1: The stale label was added and then removed again, even though there was no visible PR change. To help us debug, could you please share the relevant action logs + a minimal reproducible example (or temporary repo access)? That will confirm whether this is config-related or a bug. This looks quite similar to the main user’s issue here, so comparing both cases may help narrow down the root cause.

Image

Image 2: This looks like expected behavior: the PR went inactive → stale applied → SonarQube bot ran ✅ → since remove-stale-when-updated: true is enabled, that bot update triggered stale removal.

chiranjib-swain avatar Sep 26 '25 05:09 chiranjib-swain

The problem seems to be that when the bot adds a label, the update_at timestamp changes. So on the next run the label is removed again.

valentijnscholten avatar Oct 07 '25 07:10 valentijnscholten

First, thanks for this tool, its incredibly valuable to us.

I think the above comment is correct, the bot is counting its own changes as altering the last updated, and it seems like a regression (see #1008). And the same in our case, there no appreciable updates except the bot adding and removing 'stale' (twice!), most recently yesterday:

Image

Action run from yesterday:

[#11353] Pull request #11353
  [#11353] Found this pull request last updated at: 2025-12-08T23:01:57Z
  [#11353] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#11353] └── Continuing the process for this pull request
  [#11353] Days before pull request stale: 14
  [#11353] The pull request is not closed nor locked. Trying to remove the close label...
  [#11353] ├── The close-pr-label (​[https://github.com/actions/stale#close-pr-label​)](https://github.com/actions/stale#close-pr-label%E2%80%8B)) option was not set
  [#11353] └── Skipping the removal of the close label
  [#11353] This pull request does not include a stale label
  [#11353] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#11353] └── Continuing the process for this pull request
  [#11353] This pull request has no milestone
  [#11353] └── Skip the milestones checks
  [#11353] This pull request has no assignee
  [#11353] └── Skip the assignees checks
  [#11353] This pull request is not stale
  [#11353] The option ignore-updates (​[https://github.com/actions/stale#ignore-updates​)](https://github.com/actions/stale#ignore-updates%E2%80%8B)) is disabled. The stale counter will take into account updates and comments on this pull request to avoid to stale when there is some update
  [#11353] This pull request should be stale based on the last update date the 08-12-2025 (2025-12-08T23:01:57Z)
  [#11353] This pull request should be marked as stale based on the option days-before-pr-stale (​[https://github.com/actions/stale#days-before-pr-stale​)](https://github.com/actions/stale#days-before-pr-stale%E2%80%8B)) (14)
  [#11353] Marking this pull request as stale
  [#11353] This pull request is now stale
  [#11353] This pull request is already stale
  [#11353] Checking for label on this pull request
  [#11353] Pull request marked stale on: 2025-12-23T03:32:17Z
  [#11353] Checking for comments on pull request since: 2025-12-23T03:32:17Z
  [#11353] Comments that are not the stale comment or another bot: 0
  [#11353] Pull request has been commented on: false
  [#11353] Days before pull request close: 7
  [#11353] The option remove-stale-when-updated (​[https://github.com/actions/stale#remove-stale-when-updated​)](https://github.com/actions/stale#remove-stale-when-updated%E2%80%8B)) is: true
  [#11353] The stale label should not be removed
  [#11353] marked stale this run, so don't check for updates
  [#11353] Pull request has been updated since it was marked stale: false
  [#11353] Pull request has been updated in the last 7 days: true
  [#11353] Stale pull request is not old enough to close yet (hasComments? false, hasUpdate? true)
  [#11353] 3 operations consumed for this pull request

Action run from today:

[#11353] Pull request #11353
  [#11353] Found this pull request last updated at: 2025-12-23T03:32:45Z
  [#11353] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#11353] └── Continuing the process for this pull request
  [#11353] Days before pull request stale: 14
  [#11353] The pull request is not closed nor locked. Trying to remove the close label...
  [#11353] ├── The close-pr-label (​[https://github.com/actions/stale#close-pr-label​)](https://github.com/actions/stale#close-pr-label%E2%80%8B)) option was not set
  [#11353] └── Skipping the removal of the close label
  [#11353] This pull request includes a stale label
  [#11353] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#11353] └── Continuing the process for this pull request
  [#11353] This pull request has no milestone
  [#11353] └── Skip the milestones checks
  [#11353] This pull request has no assignee
  [#11353] └── Skip the assignees checks
  [#11353] This pull request is already stale
  [#11353] Checking for label on this pull request
  [#11353] Pull request marked stale on: 2025-12-23T03:32:17Z
  [#11353] Checking for comments on pull request since: 2025-12-23T03:32:17Z
  [#11353] Comments that are not the stale comment or another bot: 0
  [#11353] Pull request has been commented on: false
  [#11353] Days before pull request close: 7
  [#11353] The option remove-stale-when-updated (​[https://github.com/actions/stale#remove-stale-when-updated​)](https://github.com/actions/stale#remove-stale-when-updated%E2%80%8B)) is: true
  [#11353] The stale label should not be removed
  [#11353] Pull request has been updated since it was marked stale: true
  [#11353] Remove the stale label since the pull request has been updated and the workflow should remove the stale label when updated
  [#11353] The pull request is no longer stale. Removing the stale label...
  [#11353] Removing the label "stale" from this pull request...
  [#11353] The label "stale" was removed
  [#11353] Skipping the process since the pull request is now un-stale
  [#11353] 3 operations consumed for this pull request

shamoon avatar Dec 24 '25 10:12 shamoon