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
61 changes: 61 additions & 0 deletions .github/workflows/community-feedback-closer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Community Feedback Closer

on:
schedule:
- cron: '30 12 * * *' # 5:30am Redmond, daily
workflow_dispatch:

permissions:
issues: write

jobs:
close-stale-feedback:
runs-on: ubuntu-latest
steps:
- name: Close community feedback issues lacking upvotes
uses: actions/github-script@v7
with:
script: |
const label = 'needs community feedback';
const requiredUpvotes = 7;
const maxAgeDays = 60;
const cutoffDate = new Date(Date.now() - maxAgeDays * 24 * 60 * 60 * 1000);

const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
labels: label,
state: 'open',
per_page: 100,
});

for (const issue of issues) {
const createdAt = new Date(issue.created_at);
if (createdAt > cutoffDate) {
core.info(`#${issue.number} is only ${Math.floor((Date.now() - createdAt) / 86400000)} days old, skipping.`);
continue;
}

const upvotes = issue.reactions?.['+1'] ?? 0;
if (upvotes >= requiredUpvotes) {
core.info(`#${issue.number} has ${upvotes} upvotes (>= ${requiredUpvotes}), keeping open.`);
continue;
}

core.info(`Closing #${issue.number} (${upvotes} upvotes, created ${issue.created_at}).`);

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `This feature request has not received the 7 community upvotes needed to be considered for future planning within 60 days of its creation. We are closing this issue, but if the community rallies behind it in the future, we are happy to reconsider. Thank you for your feedback!\n\nHappy Coding!`,
});

await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned',
});
}
4 changes: 2 additions & 2 deletions .github/workflows/info-needed-closer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
token: ${{secrets.GITHUB_TOKEN}}
label: info-needed
closeDays: 14
closeDays: 7
closeComment: "Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. \n\nHappy Coding!"
pingDays: 14
pingDays: 7
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."
33 changes: 33 additions & 0 deletions .github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Issue labels

on:
issues:
types: [opened, reopened]

env:
TRIAGERS: '["karthiknadig","eleanorjboyd","anthonykim1"]'

permissions:
issues: write

jobs:
add-classify-label:
name: "Add 'triage-needed' and remove assignees"
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v4
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions
persist-credentials: false

- name: Install Actions
run: npm install --production --prefix ./actions

- name: "Add 'triage-needed' and remove assignees"
uses: ./actions/python-issue-labels
with:
triagers: ${{ env.TRIAGERS }}
token: ${{secrets.GITHUB_TOKEN}}
24 changes: 24 additions & 0 deletions .github/workflows/lock-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Lock Issues'

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
issues: write

concurrency:
group: lock

jobs:
lock-issues:
runs-on: ubuntu-latest
steps:
- name: 'Lock Issues'
uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # v6.0.0
with:
github-token: ${{ github.token }}
issue-inactive-days: '30'
process-only: 'issues'
log-output: true
43 changes: 43 additions & 0 deletions .github/workflows/pr-file-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PR files

on:
pull_request:
types:
- 'opened'
- 'reopened'
- 'synchronize'
- 'labeled'
- 'unlabeled'

permissions: {}

jobs:
changed-files-in-pr:
name: 'Check for changed files'
runs-on: ubuntu-latest
steps:
- name: 'package-lock.json matches package.json'
uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1
with:
prereq-pattern: 'package.json'
file-pattern: 'package-lock.json'
skip-label: 'skip package*.json'
failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)'

- name: 'package.json matches package-lock.json'
uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1
with:
prereq-pattern: 'package-lock.json'
file-pattern: 'package.json'
skip-label: 'skip package*.json'
failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)'

- name: 'Tests'
uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1
with:
prereq-pattern: src/**/*.ts
file-pattern: |
src/**/*.test.ts
src/**/*.unit.test.ts
skip-label: 'skip tests'
failure-message: 'TypeScript code was edited without also editing a test file (the ${skip-label} label can be used to pass this check)'
Loading