From 3ac7733675eed53deaa6728a456de400f26e8316 Mon Sep 17 00:00:00 2001 From: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com> Date: Wed, 30 Mar 2022 07:36:09 -0500 Subject: [PATCH] 'needs SME' label automation (#26078) * workflow for comment on adding sme label * add period * working on stale check * change name and update comment * testing * testig * tested workflows * added cron schedule for stale check * repo changed to docs * more info on SME, changed name of workflow * clarity * Update .github/workflows/needs-sme-workflow.yml Co-authored-by: Peter Bengtsson * comment for days before stale * removed default token * edited message for sme review * sme full form * changed time * Update .github/workflows/needs-sme-workflow.yml Co-authored-by: Janice * Update .github/workflows/needs-sme-workflow.yml Co-authored-by: Janice Co-authored-by: Peter Bengtsson Co-authored-by: Janice --- .github/workflows/needs-sme-stale-check.yaml | 31 ++++++++++++++++++++ .github/workflows/needs-sme-workflow.yml | 31 ++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/needs-sme-stale-check.yaml create mode 100644 .github/workflows/needs-sme-workflow.yml diff --git a/.github/workflows/needs-sme-stale-check.yaml b/.github/workflows/needs-sme-stale-check.yaml new file mode 100644 index 0000000000..f4faca3e40 --- /dev/null +++ b/.github/workflows/needs-sme-stale-check.yaml @@ -0,0 +1,31 @@ +name: Stale check for issues or PRs with "needs SME" label + +# **What it does**: Provides stale checks on issues/PRs that need SME(subject matter expert) review on open source docs repo. +# **Why we have it**: In the open repo, we want we want frequent checks on issues/PRs that are waiting on SME review. +# **Who does it impact**: Anyone working in the open repo. + +on: + schedule: + - cron: '40 20 * * *' # Run each day at 20:40 UTC / 12:40 PST + +permissions: + issues: write + pull-requests: write + +jobs: + stale_needs-sme: + if: ${{ github.repository == 'github/docs'' }} + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@7fb802b3079a276cf3c7e6ba9aa003c665b3f838 + with: + only-labels: needs SME + remove-stale-when-updated: true + days-before-stale: 7 # adds stale label if no activity for 7 days + stale-issue-message: 'This is a gentle bump for the docs team that this issue is waiting for technical review.' + stale-issue-label: SME stale + days-before-issue-close: -1 # never close + stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for technical review.' + stale-pr-label: SME stale + days-before-pr-close: -1 # never close diff --git a/.github/workflows/needs-sme-workflow.yml b/.github/workflows/needs-sme-workflow.yml new file mode 100644 index 0000000000..6a3c5dde1a --- /dev/null +++ b/.github/workflows/needs-sme-workflow.yml @@ -0,0 +1,31 @@ +name: Comment on adding "needs SME" label + +# **What it does**: Comment on issues and pull requests when a "needs SME" label is added. SME = subject matter expert. +# **Why we have it**: We want to manage our queue of issues and pull requests that need sme review. +# **Who does it impact**: Everyone that works on docs or docs-internal. + +on: + issues: + types: [labeled] + pull_request_target: + types: [labeled] + +permissions: + issues: write + pull-requests: write + +jobs: + add-comment: + if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'issues' || github.event_name == 'pull_request_target') }} + runs-on: ubuntu-latest + steps: + - uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae + with: + issue-number: ${{ github.event.issue.number }} + body: | + Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes: + - uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert :eyes: