-
Notifications
You must be signed in to change notification settings - Fork 480
Add GitHub Actions for Issue Management #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
da0d1f6
c9420c8
4184a4e
8b7042c
e39b193
cfb43f0
3dcfb5a
df5bc5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||
| name: Close issue/PR on adding invalid label | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # **What it does**: This action closes issues that are labeled as invalid in the repo. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| issues: | ||||||||||||||||||||
| types: [labeled] | ||||||||||||||||||||
|
Comment on lines
+5
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: doesn't this need the
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| issues: write | ||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| close-on-adding-invalid-label: | ||||||||||||||||||||
| if: | ||||||||||||||||||||
| github.repository == 'github/copilot-cli' && github.event.label.name == | ||||||||||||||||||||
| 'invalid' | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Close issue | ||||||||||||||||||||
| if: ${{ github.event_name == 'issues' }} | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||
| run: gh issue close ${{ github.event.issue.html_url }} | ||||||||||||||||||||
|
Comment on lines
+24
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggest: use intermediate variables to avoid interpolating context in
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| - 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 }} | ||||||||||||||||||||
tidy-dev marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Close Single-Word Issues | ||
|
|
||
| on: | ||
| issues: | ||
| types: | ||
| - opened | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| close-issue: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Close Single-Word Issue | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const issueTitle = context.payload.issue.title.trim(); | ||
| const isSingleWord = /^\S+$/.test(issueTitle); | ||
|
|
||
| if (isSingleWord) { | ||
| const issueNumber = context.payload.issue.number; | ||
| const repo = context.repo.repo; | ||
|
|
||
| // Close the issue and add the invalid label | ||
| github.rest.issues.update({ | ||
| owner: context.repo.owner, | ||
| repo: repo, | ||
| issue_number: issueNumber, | ||
| labels: ['invalid'], | ||
| state: 'closed' | ||
| }); | ||
|
|
||
| // Comment on the issue | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: repo, | ||
| issue_number: issueNumber, | ||
| body: `This issue may have been opened accidentally. I'm going to close it now, but feel free to open a new issue with a more descriptive title.` | ||
| }); | ||
| } | ||
|
Comment on lines
+16
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: this might be an opportunity to utilize https://github.com/github/ai-moderator for detecting spam like this 🤔
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting - Sounds like a neat potential iteration. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Add enhancement comment | ||
| on: | ||
| issues: | ||
| types: | ||
| - labeled | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| add-comment-to-enhancement-issues: | ||
| if: github.event.label.name == 'enhancement' | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_REPO: ${{ github.repository }} | ||
| NUMBER: ${{ github.event.issue.number }} | ||
| BODY: > | ||
| Thank you for your issue! We have categorized it as an enhancement, | ||
| and it has been added to our backlog. In doing so, **we are not | ||
| committing to implementing this feature at this time**, but, we will | ||
| consider it for future releases based on community feedback and our own | ||
| product roadmap. | ||
| **If you come across this issue and would like to see it implemented, | ||
| please add a thumbs up!** This will help us prioritize the feature. | ||
| Please only comment if you have additional information or viewpoints to | ||
| contribute. | ||
| steps: | ||
| - run: gh issue comment "$NUMBER" --body "$BODY" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: No Response | ||
|
|
||
| # Both `issue_comment` and `scheduled` event types are required for this Action | ||
| # to work properly. | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| schedule: | ||
| # Schedule for five minutes after the hour, every hour | ||
| - cron: '5 * * * *' | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| noResponse: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: lee-dohm/no-response@v0.5.0 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| closeComment: > | ||
| 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 | ||
| 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 | ||
|
Comment on lines
+16
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: I would have imaged the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be able to use it for the same thing. We implemented Looks to me like |
||
| responseRequiredLabel: more-info-needed | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Remove triage tab from closed issues | ||
| on: | ||
| issues: | ||
| types: | ||
| - closed | ||
| jobs: | ||
| label_issues: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| steps: | ||
| - run: gh issue edit "$NUMBER" --remove-label "$LABELS" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_REPO: ${{ github.repository }} | ||
| NUMBER: ${{ github.event.issue.number }} | ||
| LABELS: triage | ||
tidy-dev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Remove triage label | ||
| on: | ||
| issues: | ||
| types: | ||
| - labeled | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| remove-triage-label-from-issues: | ||
| if: | ||
| github.event.label.name != 'triage' && github.event.label.name != | ||
| 'more-info-needed' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - run: gh issue edit "$NUMBER" --remove-label "$LABELS" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_REPO: ${{ github.repository }} | ||
| NUMBER: ${{ github.event.issue.number }} | ||
| LABELS: triage |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: 'Marks stale issues and PRs' | ||
| on: | ||
| schedule: | ||
| - cron: '30 1 * * *' # 1:30 AM UTC | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| stale: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/stale@v9 | ||
| with: | ||
| stale-issue-label: 'stale, triage' # The label that will be added to the issues when automatically marked as stale | ||
| start-date: '2025-01-01T00:00:00Z' # Skip stale action for issues created before it | ||
| days-before-stale: 365 | ||
| days-before-close: -1 # If -1, the issues nor pull requests will never be closed automatically. | ||
| days-before-pr-stale: -1 # If -1, no pull requests will be marked as stale automatically. | ||
| exempt-issue-labels: 'never-stale, help wanted' # issues labeled as such will be excluded them from being marked as stale |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||
| name: Add unable-to-reproduce comment | ||||||||||||||||||
| on: | ||||||||||||||||||
| issues: | ||||||||||||||||||
| types: | ||||||||||||||||||
| - labeled | ||||||||||||||||||
|
|
||||||||||||||||||
| permissions: | ||||||||||||||||||
| issues: write | ||||||||||||||||||
|
|
||||||||||||||||||
| 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. | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| 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" | ||||||||||||||||||
|
Comment on lines
+42
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: consolidating these runs into a single step with a name and moving the
Suggested change
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: is it worth consolidating
labeledworkflows?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly.. I kind of like the organization of separate .ymls for separate purposes... but not sure if that sacrifices anything action runner wise.