Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/close-invalid.yml
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
Copy link
Contributor

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 labeled workflows?

Copy link
Contributor Author

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.

Comment on lines +5 to +7
Copy link
Contributor

Choose a reason for hiding this comment

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

question: doesn't this need the pull_request_target event to handle PRs?

Suggested change
on:
issues:
types: [labeled]
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]


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
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest: use intermediate variables to avoid interpolating context in run blocks

Suggested change
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue close ${{ github.event.issue.html_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }}
44 changes: 44 additions & 0 deletions .github/workflows/close-single-word-issues.yml
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting - Sounds like a neat potential iteration.

31 changes: 31 additions & 0 deletions .github/workflows/feature-request-comment.yml
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"
32 changes: 32 additions & 0 deletions .github/workflows/no-response.yml
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
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I would have imaged the actions/stale would provide support for this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be able to use it for the same thing. We implemented lee-dohm/no-response quite a bit (like years) before actions/stale was a thing and simply didn't look to change what wasn't broken. :D

Looks to me like actions/stale does have "only-labels" which would likely allow you to accomplish the same goal in conjunction to the same "more-info-needed" label as well as a 'close-issue-message"

responseRequiredLabel: more-info-needed
17 changes: 17 additions & 0 deletions .github/workflows/on-issue-close.yml
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
22 changes: 22 additions & 0 deletions .github/workflows/remove-triage-label.yml
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
20 changes: 20 additions & 0 deletions .github/workflows/stale-issues.yml
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
44 changes: 44 additions & 0 deletions .github/workflows/unable-to-reproduce-comment.yml
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 env from the job to the step would make this easier to maintain

Suggested change
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
- run: gh issue comment "$NUMBER" --body "$BODY"
steps:
- name: Update issue
run: |
gh issue edit "$NUMBER" --add-label "$LABELS"
gh issue comment "$NUMBER" --body "$BODY"

Loading