add workflows to triage open-source issues and pulls (#67)
This commit is contained in:
46
.github/workflows/triage-issue-comments.yml
vendored
Normal file
46
.github/workflows/triage-issue-comments.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Triage new issue comments
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
triage-issue-comments:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check if the event originated from a team member
|
||||
uses: actions/github-script@v2.0.0
|
||||
id: is-internal-contributor
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
result-encoding: string
|
||||
script: |
|
||||
const repo = context.payload.repository.name
|
||||
const org = context.payload.repository.owner.login
|
||||
const actor = context.actor
|
||||
let collaboratorStatus = ''
|
||||
try {
|
||||
collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', {
|
||||
owner: org,
|
||||
repo: repo,
|
||||
username: actor
|
||||
})
|
||||
console.log(`This issue was commented on by a Hubber.`)
|
||||
return 'true'
|
||||
} catch (error) {
|
||||
console.log(`This issue was commented on by an external contributor.`)
|
||||
return 'false'
|
||||
}
|
||||
- name: Label issues with new comments with 'triage'
|
||||
uses: andymckay/labeler@v1.0.2
|
||||
if: (steps.is-internal-contributor.outputs.result == 'false')
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
add-labels: "triage"
|
||||
- name: Triage to project board
|
||||
uses: konradpabjan/actions-add-new-issue-to-column@v1.1
|
||||
with:
|
||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
project-url: "https://github.com/github/docs/projects/1"
|
||||
column-name: "Triage"
|
||||
22
.github/workflows/triage-issues.yml
vendored
Normal file
22
.github/workflows/triage-issues.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Triage new issues
|
||||
on:
|
||||
issues:
|
||||
types: [reopened, opened]
|
||||
|
||||
jobs:
|
||||
triage_issues:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Label new issues with 'triage'
|
||||
uses: andymckay/labeler@v1.0.2
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
add-labels: "triage"
|
||||
- name: Triage to project board
|
||||
uses: konradpabjan/actions-add-new-issue-to-column@v1.1
|
||||
with:
|
||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
project-url: "https://github.com/github/docs/projects/1"
|
||||
column-name: "Triage"
|
||||
22
.github/workflows/triage-pull-requests.yml
vendored
Normal file
22
.github/workflows/triage-pull-requests.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Triage new pull requests
|
||||
on:
|
||||
pull_request:
|
||||
types: [reopened, opened]
|
||||
|
||||
jobs:
|
||||
triage_issues:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Label new pull requests with 'triage'
|
||||
uses: andymckay/labeler@v1.0.2
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
add-labels: "triage"
|
||||
- name: Triage to project board
|
||||
uses: konradpabjan/actions-add-new-issue-to-column@v1.1
|
||||
with:
|
||||
action-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
project-url: "https://github.com/github/docs/projects/1"
|
||||
column-name: "Triage"
|
||||
18
.github/workflows/triage-stale-check.yml
vendored
Normal file
18
.github/workflows/triage-stale-check.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Public Repo Stale Check
|
||||
on:
|
||||
schedule:
|
||||
- cron: "45 16 * * *" # Run each day at 16:45 UTC / 8:45 PST
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
|
||||
days-before-stale: 7
|
||||
days-before-close: 10
|
||||
stale-pr-label: 'stale'
|
||||
Reference in New Issue
Block a user