Ability to ignore label changes as "updates"

Open
#1,301 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, typescript
Domain
ci-cd, devops

Research direction

Start by tracing how actions/stale v9 determines whether a pull request has been updated and how label operations affect that decision. The example workflow shows the cascading stale-label case; done means providing a documented way to ignore label changes while preserving normal update handling. No source file or test is named in the issue.

Written by the indexing model from the issue text.

Description

feature request

Description:

A way to ignore labeling as an "update". When the action adds a stale label to a PR, that PR is now considered "updated" as of that time, and is no longer stale during the next run.

Justification:

Trying to have cascading stale levels, however, when a stale label is added the PR is now considered "updated" and no longer stale on the next run, removing that stale level on the next run.

Are you willing to submit a PR?

Unsure, I wouldn't know where to start here.


Example workflow:

name: Stale PR Management

permissions:
    issues: write
    pull-requests: write

on:
    pull_request:
        types: [opened]
    schedule:
        - cron: '0 * * * *' # Runs every hour
    workflow_dispatch:

jobs:
    label-new-prs:
        runs-on: ubuntu-latest
        if: github.event_name == 'pull_request' && github.event.action == 'opened'
        steps:
            - uses: actions/github-script@v8
              with:
                  script: |
                      await github.rest.issues.addLabels({
                        owner: context.repo.owner,
                        repo: context.repo.repo,
                        issue_number: context.issue.number,
                        labels: ['🌱 fresh']
                      });

    mark-relic:
        runs-on: ubuntu-latest
        if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
        steps:
            - uses: actions/stale@v9
              with:
                  repo-token: ${{ secrets.GITHUB_TOKEN }}
                  days-before-stale: 15
                  days-before-close: -1
                  days-before-issue-stale: -1
                  stale-pr-label: '🗿 relic'
                  labels-to-remove-when-unstale: '🗿 relic'
                  labels-to-remove-when-stale: '🌱 fresh,🍞 stale'
                  exempt-pr-labels: ''
                  operations-per-run: 100

    mark-stale:
        runs-on: ubuntu-latest
        if: github.event_name == 'schedule'  || github.event_name == 'workflow_dispatch'
        needs: mark-relic
        steps:
            - uses: actions/stale@v9
              with:
                  repo-token: ${{ secrets.GITHUB_TOKEN }}
                  days-before-stale: 7
                  days-before-close: -1
                  days-before-issue-stale: -1
                  stale-pr-label: '🍞 stale'
                  labels-to-add-when-unstale: '🌱 fresh'
                  labels-to-remove-when-unstale: '🗿 relic,🍞 stale'
                  labels-to-remove-when-stale: '🌱 fresh'
                  exempt-pr-labels: '🗿 relic'
                  operations-per-run: 100

Dominant language
TypeScript
Stars
1.7k
Forks
438
Avg merge
27d 8h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from actions/stale

All issues in actions/stale

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.