1
0
mirror of synced 2025-12-19 18:10:59 -05:00

add workflows to triage open-source issues and pulls (#67)

This commit is contained in:
Rachael Sewell
2020-10-01 14:04:08 -07:00
committed by GitHub
parent 7271fb2cc0
commit f9c2a6ee4c
4 changed files with 108 additions and 0 deletions

View 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
View 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"

View 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"

View 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'