diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..739fc56a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,4 @@ +- name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: 'csharp' diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml deleted file mode 100644 index f30d760e..00000000 --- a/.github/workflows/triage.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Triage Issues and PRs - -on: - issues: - types: [opened, edited] - pull_request: - types: [opened, edited] - -jobs: - triage: - runs-on: ubuntu-latest - - steps: - - name: Assign Labels - uses: actions/github-script@v6 - with: - script: | - let issue_number = context.payload.issue?.number || context.payload.pull_request?.number; - let title = context.payload.issue?.title?.toLowerCase() || context.payload.pull_request?.title?.toLowerCase() || ''; - let body = context.payload.issue?.body?.toLowerCase() || context.payload.pull_request?.body?.toLowerCase() || ''; - - const labels = []; - if (title.includes('bug') || body.includes('bug') || title.includes('error') || body.includes('error') || title.includes('problem') || body.includes('problem')) { - labels.push('bug'); - } else if (title.includes('feature') || body.includes('feature') || title.includes('request') || body.includes('request') || title.includes('suggestion') || body.includes('suggestion') || title.includes('improvement') || body.includes('improvement')) { - labels.push('enhancement'); - } else if (title.includes('docs') || body.includes('docs') || title.includes('documentation') || body.includes('documentation')) { - labels.push('documentation'); - } else if (title.includes('question') || body.includes('question')) { - labels.push('question'); - } else { - labels.push('needs-triage'); - } - - if (issue_number) { - await github.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number, - labels, - }); - } - - - name: Assign to PaulAndersonS (Issues only) - if: github.event.issue != null - uses: actions/github-script@v6 - with: - script: | - await github.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.issue.number, - assignees: ['PaulAndersonS'] - }); - - - name: Add Comment (Issues) - if: github.event.issue != null - uses: actions/github-script@v6 - with: - script: | - const title = context.payload.issue.title.toLowerCase(); - let type = 'issue'; - if (title.includes('bug')) { - type = 'bug report'; - } else if (title.includes('feature')) { - type = 'feature request'; - } else if (title.includes('docs') || title.includes('documentation')) { - type = 'documentation update'; - } else if (title.includes('question')) { - type = 'question'; - } - const comment = `Thank you for your ${type}! We will review it soon.`; - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.issue.number, - body: comment - }); - - - name: Add Comment (Pull Requests) - if: github.event.pull_request != null - uses: actions/github-script@v6 - with: - script: | - const title = context.payload.pull_request.title.toLowerCase(); - let type = 'pull request'; - if (title.includes('bugfix') || title.includes('fix')) { - type = 'bug fix PR'; - } else if (title.includes('feature')) { - type = 'feature PR'; - } else if (title.includes('docs') || title.includes('documentation')) { - type = 'documentation PR'; - } - const comment = `Thank you for your ${type}! We will review it soon.`; - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - body: comment - }); - - - name: Close Stale Issues and PRs - uses: actions/stale@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.' - stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.' - days-before-stale: 60 - days-before-close: 14