forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflows to triage open-source issues and pulls (#67)
- Loading branch information
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
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/[email protected] | ||
if: (steps.is-internal-contributor.outputs.result == 'false') | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
add-labels: "triage" | ||
- name: Triage to project board | ||
uses: konradpabjan/[email protected] | ||
with: | ||
action-token: ${{ secrets.GITHUB_TOKEN }} | ||
project-url: "https://github.com/github/docs/projects/1" | ||
column-name: "Triage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
add-labels: "triage" | ||
- name: Triage to project board | ||
uses: konradpabjan/[email protected] | ||
with: | ||
action-token: ${{ secrets.GITHUB_TOKEN }} | ||
project-url: "https://github.com/github/docs/projects/1" | ||
column-name: "Triage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
add-labels: "triage" | ||
- name: Triage to project board | ||
uses: konradpabjan/[email protected] | ||
with: | ||
action-token: ${{ secrets.GITHUB_TOKEN }} | ||
project-url: "https://github.com/github/docs/projects/1" | ||
column-name: "Triage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |