Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 10, 2025

This pull request was created as a result of the following prompt in Copilot Chat.

Original prompt - submitted by @felicitymay

This workflow update introduces separate stale handling for pull requests in the 'docs-internal' repository. In 'docs-internal', PRs are marked as stale after 14 days of inactivity, with a custom comment for the stale event and a different custom comment for the close event. In 'docs', the original behavior (365 days for both issues and PRs) is preserved. Issues in both repositories continue to use a 365-day threshold.

Changes

This PR updates the .github/workflows/stale.yml workflow to handle stale issue and PR management differently for the docs-internal and docs repositories:

For github/docs-internal:

  • PRs: Marked stale after 14 days of inactivity
  • Issues: Continue using 365 days threshold (unchanged)
  • Custom PR stale message: "This PR has been automatically marked as stale due to 14 days of inactivity. Please update soon to avoid closure."
  • Custom PR close message: "Closing this PR due to prolonged inactivity. If you wish to continue, please reopen."

For github/docs:

  • PRs and Issues: Maintain original 365 days threshold
  • Messages: Keep existing generic stale/close messages

Technical Implementation:

  • Split the single workflow step into two separate steps with repository-specific conditions
  • Added days-before-stale-pr: 14 parameter for docs-internal
  • Configured custom stale-pr-message and close-pr-message for docs-internal
  • Preserved all existing configuration (labels, exemptions, operations-per-run, etc.)
  • Maintained existing failure handling with slack alerts

Preserved Behavior:

  • Same schedule (daily at 16:20 UTC / 8:20 PST)
  • Same repository scope conditions
  • Same labels (stale) and exempt labels (never-stale, waiting for review, help wanted)
  • Same failure handling with checkout and slack alerts
  • Same action version and security hash

This change allows docs-internal to have more aggressive PR stale handling while keeping the docs repository behavior unchanged, improving workflow efficiency for internal documentation management.

This pull request was created as a result of the following prompt from Copilot chat.

This workflow update introduces separate stale handling for pull requests in the 'docs-internal' repository. In 'docs-internal', PRs are marked as stale after 14 days of inactivity, with a custom comment for the stale event and a different custom comment for the close event. In 'docs', the original behavior (365 days for both issues and PRs) is preserved. Issues in both repositories continue to use a 365-day threshold.

The following changes are made to .github/workflows/stale.yml:

  • Split the stale handling into two steps, conditioned on the repository name.
  • For 'github/docs-internal':
    • PRs are marked stale after 14 days (days-before-stale-pr: 14).
    • Custom message for PR stale event: 'This PR has been automatically marked as stale due to 14 days of inactivity. Please update soon to avoid closure.'
    • Custom message for PR close event: 'Closing this PR due to prolonged inactivity. If you wish to continue, please reopen.'
  • For 'github/docs':
    • PRs and issues keep the original threshold (365 days).
  • Issues in both repositories use the same (original) stale logic and messaging.

No changes are made to actions, labels, or exempt labels.


Here is the updated workflow file:

name: Stale

on:
  schedule:
    - cron: '20 16 * * *' # Run every day at 16:20 UTC / 8:20 PST

permissions:
  contents: read
  issues: write
  pull-requests: write

jobs:
  stale:
    if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
    runs-on: ubuntu-latest
    steps:
      - name: Mark stale issues and PRs (docs-internal)
        if: github.repository == 'github/docs-internal'
        uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          stale-issue-message: 'This issue is stale because there have been no updates in 365 days.'
          stale-pr-message: 'This PR has been automatically marked as stale due to 14 days of inactivity. Please update soon to avoid closure.'
          close-pr-message: 'Closing this PR due to prolonged inactivity. If you wish to continue, please reopen.'
          days-before-stale: 365
          days-before-close: 0
          days-before-stale-pr: 14
          stale-issue-label: 'stale'
          stale-pr-label: 'stale'
          exempt-pr-labels: 'never-stale,waiting for review'
          exempt-issue-labels: 'never-stale,help wanted,waiting for review'
          operations-per-run: 1000
          close-issue-reason: not_planned

      - name: Mark stale issues and PRs (docs)
        if: github.repository == 'github/docs'
        uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          stale-issue-message: 'This issue is stale because there have been no updates in 365 days.'
          stale-pr-message: 'This PR is stale because there have been no updates in 365 days.'
          close-pr-message: 'This PR is being closed due to inactivity.'
          days-before-stale: 365
          days-before-close: 0
          stale-issue-label: 'stale'
          stale-pr-label: 'stale'
          exempt-pr-labels: 'never-stale,waiting for review'
          exempt-issue-labels: 'never-stale,help wanted,waiting for review'
          operations-per-run: 1000
          close-issue-reason: not_planned

      - name: Check out repo
        if: ${{ failure() }}
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: ./.github/actions/slack-alert
        if: ${{ failure() }}
        with:
          slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
          slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

No other files are affected.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jul 10, 2025
Copilot AI changed the title [WIP] Stale workflow: separate PR handling for docs-internal with custom messages and 14-day threshold Split stale workflow handling for docs-internal and docs repositories Jul 10, 2025
Copilot AI requested a review from felicitymay July 10, 2025 19:30
@github-actions
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:

  • .github/workflows/stale.yml

You'll need to revert all of the files you changed that match that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

The complete list of files we can't accept are:

  • .devcontainer/**
  • .github/**
  • data/reusables/rai/**
  • Dockerfile*
  • src/**
  • package*.json
  • content/actions/how-tos/security-for-github-actions/security-hardening-your-deployments/**

We also can't accept contributions to files in the content directory with frontmatter type: rai.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2025

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

This pull request contains code changes, so we will not generate a table of review links.

🤖 This comment is automatically generated.

@github-actions
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:

  • .github/workflows/stale.yml

You'll need to revert all of the files you changed that match that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

The complete list of files we can't accept are:

  • .devcontainer/**
  • .github/**
  • data/reusables/rai/**
  • Dockerfile*
  • src/**
  • package*.json
  • content/actions/how-tos/security-for-github-actions/security-hardening-your-deployments/**

We also can't accept contributions to files in the content directory with frontmatter type: rai.

Copy link
Contributor

@felicitymay felicitymay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Thanks for your work. I will commit my suggested changes and then you can go ahead and work on the remaining comments.

Comment on lines 3 to 6
# **What it does**: Close issues and pull requests after no updates for 365 days.
# **Why we have it**: We want to manage our queue of issues and pull requests.
# **Who does it impact**: Everyone that works on docs or docs-internal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot - please revert the deletion of this comment and instead update it to match the new behavior of the workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored the workflow comment block and updated it to reflect the new behavior. The comment now accurately describes that issues and PRs are closed after 365 days (docs) or 14 days for PRs (docs-internal). Fixed in commit 44469be.

@github-actions
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:

  • .github/workflows/stale.yml

You'll need to revert all of the files you changed that match that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

The complete list of files we can't accept are:

  • .devcontainer/**
  • .github/**
  • data/reusables/rai/**
  • Dockerfile*
  • src/**
  • package*.json
  • content/actions/how-tos/security-for-github-actions/security-hardening-your-deployments/**

We also can't accept contributions to files in the content directory with frontmatter type: rai.

Copilot AI requested a review from felicitymay July 10, 2025 19:58
@felicitymay
Copy link
Contributor

Copilot. I just realized that you opened this PR in the wrong repository.

I'm going to close this and ask you to open a PR in the correct repository.

@felicitymay felicitymay deleted the copilot/fix-f8b72a54-0c7e-44f5-ab62-6cc1853a5dc3 branch July 10, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants