Skip to content

Commit 49fcf83

Browse files
committed
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
1 parent df5bc5b commit 49fcf83

File tree

3 files changed

+51
-43
lines changed

3 files changed

+51
-43
lines changed

.github/workflows/close-invalid.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ name: Close issue/PR on adding invalid label
55
on:
66
issues:
77
types: [labeled]
8+
pull_request_target:
9+
types: [labeled]
810

911
permissions:
1012
contents: read
@@ -23,10 +25,12 @@ jobs:
2325
if: ${{ github.event_name == 'issues' }}
2426
env:
2527
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
run: gh issue close ${{ github.event.issue.html_url }}
28+
URL: ${{ github.event.issue.html_url }}
29+
run: gh issue close $URL
2730

2831
- name: Close PR
2932
if: ${{ github.event_name == 'pull_request_target' }}
3033
env:
3134
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
run: gh pr close ${{ github.event.pull_request.html_url }}
35+
URL: ${{ github.event.pull_request.html_url }}
36+
run: gh pr close $URL

.github/workflows/no-response.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: No Response
22

3-
# Both `issue_comment` and `scheduled` event types are required for this Action
4-
# to work properly.
3+
# Automatically close issues labeled 'more-info-needed' after 7 days of inactivity
54
on:
6-
issue_comment:
7-
types: [created]
85
schedule:
96
# Schedule for five minutes after the hour, every hour
107
- cron: '5 * * * *'
@@ -16,17 +13,22 @@ jobs:
1613
noResponse:
1714
runs-on: ubuntu-latest
1815
steps:
19-
- uses: lee-dohm/no-response@v0.5.0
16+
- uses: actions/stale@v9
2017
with:
21-
token: ${{ secrets.GITHUB_TOKEN }}
22-
closeComment: >
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
only-issue-labels: 'more-info-needed'
20+
days-before-issue-stale: -1 # Skip stale state, go directly to close
21+
days-before-issue-close: 7 # Close after 7 days of inactivity
22+
days-before-pr-stale: -1 # Don't process PRs
23+
days-before-pr-close: -1 # Don't process PRs
24+
remove-stale-when-updated: true
25+
close-issue-message: >
2326
Thank you for your issue!
2427
25-
We havent gotten a response to our questions above. With only the
26-
information that is currently in the issue, we dont have enough
27-
information to take action. Were going to close this but dont
28+
We haven't gotten a response to our questions above. With only the
29+
information that is currently in the issue, we don't have enough
30+
information to take action. We're going to close this but don't
2831
hesitate to reach out if you have or find the answers we need. If
2932
you answer our questions above, this issue will automatically
3033
reopen.
31-
daysUntilClose: 7
32-
responseRequiredLabel: more-info-needed
34+
close-issue-reason: 'not_planned'

.github/workflows/unable-to-reproduce-comment.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,36 @@ jobs:
1111
add-comment-to-unable-to-reproduce-issues:
1212
if: github.event.label.name == 'unable-to-reproduce'
1313
runs-on: ubuntu-latest
14-
env:
15-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16-
GH_REPO: ${{ github.repository }}
17-
NUMBER: ${{ github.event.issue.number }}
18-
LABELS: more-info-needed
19-
BODY: >
20-
Thank you for your issue! Unfortunately, we are unable to reproduce the
21-
issue you are experiencing. Please provide more information so we can
22-
help you.
14+
steps:
15+
- name: Update issue
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GH_REPO: ${{ github.repository }}
19+
NUMBER: ${{ github.event.issue.number }}
20+
LABELS: more-info-needed
21+
BODY: >
22+
Thank you for your issue! Unfortunately, we are unable to reproduce the
23+
issue you are experiencing. Please provide more information so we can
24+
help you.
2325
2426
25-
Here are some tips for writing reproduction steps:
26-
- Step by step instructions accompanied by screenshots or screencasts
27-
are the best.
28-
- Be as specific as possible; include as much detail as you can.
29-
- If not already provided, include:
30-
- the version of Copilot CLI you are using.
31-
- the operating system you are using
32-
- any environment factors you can think of.
33-
- any custom configuration you are using.
34-
- a log file from the day you experienced the issue (find log
35-
files via `~/.copilot/logs`.
36-
- If relevant and can be shared, provide the repository or code you
37-
are using.
38-
- If relevant and can be shared, provide the session files (find session files via `~/.copilot/history-session-state`).
39-
40-
Note: This is a public repository. Please do not include any sensitive or
41-
private information in your issue.
42-
steps:
43-
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
44-
- run: gh issue comment "$NUMBER" --body "$BODY"
27+
Here are some tips for writing reproduction steps:
28+
- Step by step instructions accompanied by screenshots or screencasts
29+
are the best.
30+
- Be as specific as possible; include as much detail as you can.
31+
- If not already provided, include:
32+
- the version of Copilot CLI you are using.
33+
- the operating system you are using
34+
- any environment factors you can think of.
35+
- any custom configuration you are using.
36+
- a log file from the day you experienced the issue (find log
37+
files via `~/.copilot/logs`.
38+
- If relevant and can be shared, provide the repository or code you
39+
are using.
40+
- If relevant and can be shared, provide the session files (find session files via `~/.copilot/history-session-state`).
41+
42+
Note: This is a public repository. Please do not include any sensitive or
43+
private information in your issue.
44+
run: |
45+
gh issue edit "$NUMBER" --add-label "$LABELS"
46+
gh issue comment "$NUMBER" --body "$BODY"

0 commit comments

Comments
 (0)