From 49fcf836d9f7ecaff8149f6aec77ba1c02480b78 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:23:56 -0400 Subject: [PATCH] Iterate on issue management - Add pull_request_target event to close-invalid.yml for PR support - Use intermediate environment variables for security in close-invalid.yml - Fix grammar error in stale-issues.yml comment - Consolidate workflow steps in unable-to-reproduce-comment.yml for better maintainability --- .github/workflows/close-invalid.yml | 8 ++- .github/workflows/no-response.yml | 26 ++++---- .../workflows/unable-to-reproduce-comment.yml | 60 ++++++++++--------- 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/.github/workflows/close-invalid.yml b/.github/workflows/close-invalid.yml index b4cc924..4078bd8 100644 --- a/.github/workflows/close-invalid.yml +++ b/.github/workflows/close-invalid.yml @@ -5,6 +5,8 @@ name: Close issue/PR on adding invalid label on: issues: types: [labeled] + pull_request_target: + types: [labeled] permissions: contents: read @@ -23,10 +25,12 @@ jobs: if: ${{ github.event_name == 'issues' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh issue close ${{ github.event.issue.html_url }} + URL: ${{ github.event.issue.html_url }} + run: gh issue close $URL - name: Close PR if: ${{ github.event_name == 'pull_request_target' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr close ${{ github.event.pull_request.html_url }} + URL: ${{ github.event.pull_request.html_url }} + run: gh pr close $URL diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 44d543d..2a864dd 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -1,10 +1,7 @@ name: No Response -# Both `issue_comment` and `scheduled` event types are required for this Action -# to work properly. +# Automatically close issues labeled 'more-info-needed' after 7 days of inactivity on: - issue_comment: - types: [created] schedule: # Schedule for five minutes after the hour, every hour - cron: '5 * * * *' @@ -16,17 +13,22 @@ jobs: noResponse: runs-on: ubuntu-latest steps: - - uses: lee-dohm/no-response@v0.5.0 + - uses: actions/stale@v9 with: - token: ${{ secrets.GITHUB_TOKEN }} - closeComment: > + repo-token: ${{ secrets.GITHUB_TOKEN }} + only-issue-labels: 'more-info-needed' + days-before-issue-stale: -1 # Skip stale state, go directly to close + days-before-issue-close: 7 # Close after 7 days of inactivity + days-before-pr-stale: -1 # Don't process PRs + days-before-pr-close: -1 # Don't process PRs + remove-stale-when-updated: true + close-issue-message: > Thank you for your issue! - We haven’t gotten a response to our questions above. With only the - information that is currently in the issue, we don’t have enough - information to take action. We’re going to close this but don’t + We haven't gotten a response to our questions above. With only the + information that is currently in the issue, we don't have enough + information to take action. We're going to close this but don't hesitate to reach out if you have or find the answers we need. If you answer our questions above, this issue will automatically reopen. - daysUntilClose: 7 - responseRequiredLabel: more-info-needed + close-issue-reason: 'not_planned' diff --git a/.github/workflows/unable-to-reproduce-comment.yml b/.github/workflows/unable-to-reproduce-comment.yml index ad6b468..195739a 100644 --- a/.github/workflows/unable-to-reproduce-comment.yml +++ b/.github/workflows/unable-to-reproduce-comment.yml @@ -11,34 +11,36 @@ jobs: add-comment-to-unable-to-reproduce-issues: if: github.event.label.name == 'unable-to-reproduce' runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number }} - LABELS: more-info-needed - BODY: > - Thank you for your issue! Unfortunately, we are unable to reproduce the - issue you are experiencing. Please provide more information so we can - help you. + steps: + - name: Update issue + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + LABELS: more-info-needed + BODY: > + Thank you for your issue! Unfortunately, we are unable to reproduce the + issue you are experiencing. Please provide more information so we can + help you. - Here are some tips for writing reproduction steps: - - Step by step instructions accompanied by screenshots or screencasts - are the best. - - Be as specific as possible; include as much detail as you can. - - If not already provided, include: - - the version of Copilot CLI you are using. - - the operating system you are using - - any environment factors you can think of. - - any custom configuration you are using. - - a log file from the day you experienced the issue (find log - files via `~/.copilot/logs`. - - If relevant and can be shared, provide the repository or code you - are using. - - If relevant and can be shared, provide the session files (find session files via `~/.copilot/history-session-state`). - - Note: This is a public repository. Please do not include any sensitive or - private information in your issue. - steps: - - run: gh issue edit "$NUMBER" --add-label "$LABELS" - - run: gh issue comment "$NUMBER" --body "$BODY" + Here are some tips for writing reproduction steps: + - Step by step instructions accompanied by screenshots or screencasts + are the best. + - Be as specific as possible; include as much detail as you can. + - If not already provided, include: + - the version of Copilot CLI you are using. + - the operating system you are using + - any environment factors you can think of. + - any custom configuration you are using. + - a log file from the day you experienced the issue (find log + files via `~/.copilot/logs`. + - If relevant and can be shared, provide the repository or code you + are using. + - If relevant and can be shared, provide the session files (find session files via `~/.copilot/history-session-state`). + + Note: This is a public repository. Please do not include any sensitive or + private information in your issue. + run: | + gh issue edit "$NUMBER" --add-label "$LABELS" + gh issue comment "$NUMBER" --body "$BODY"