diff --git a/.github/workflows/close-invalid.yml b/.github/workflows/close-invalid.yml new file mode 100644 index 0000000..b4cc924 --- /dev/null +++ b/.github/workflows/close-invalid.yml @@ -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] + +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 }} + + - 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 }} diff --git a/.github/workflows/close-single-word-issues.yml b/.github/workflows/close-single-word-issues.yml new file mode 100644 index 0000000..f2ef0da --- /dev/null +++ b/.github/workflows/close-single-word-issues.yml @@ -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.` + }); + } diff --git a/.github/workflows/feature-request-comment.yml b/.github/workflows/feature-request-comment.yml new file mode 100644 index 0000000..f347eb6 --- /dev/null +++ b/.github/workflows/feature-request-comment.yml @@ -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" diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml new file mode 100644 index 0000000..44d543d --- /dev/null +++ b/.github/workflows/no-response.yml @@ -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 + responseRequiredLabel: more-info-needed diff --git a/.github/workflows/on-issue-close.yml b/.github/workflows/on-issue-close.yml new file mode 100644 index 0000000..e768226 --- /dev/null +++ b/.github/workflows/on-issue-close.yml @@ -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 diff --git a/.github/workflows/remove-triage-label.yml b/.github/workflows/remove-triage-label.yml new file mode 100644 index 0000000..b4834e0 --- /dev/null +++ b/.github/workflows/remove-triage-label.yml @@ -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 diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml new file mode 100644 index 0000000..3ec537c --- /dev/null +++ b/.github/workflows/stale-issues.yml @@ -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 diff --git a/.github/workflows/unable-to-reproduce-comment.yml b/.github/workflows/unable-to-reproduce-comment.yml new file mode 100644 index 0000000..ad6b468 --- /dev/null +++ b/.github/workflows/unable-to-reproduce-comment.yml @@ -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"