From a084c39ed3e3d2e93b72bc9ef83fa62b6bddfae5 Mon Sep 17 00:00:00 2001 From: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:32:28 -0700 Subject: [PATCH] Create sme-review-tracking-issue.md (#49763) Co-authored-by: skedwards88 --- .github/sme-review-tracking-issue.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/sme-review-tracking-issue.yml diff --git a/.github/sme-review-tracking-issue.yml b/.github/sme-review-tracking-issue.yml new file mode 100644 index 0000000000..327a4a0d5a --- /dev/null +++ b/.github/sme-review-tracking-issue.yml @@ -0,0 +1,58 @@ +name: Create SME review tracking issue + +# **What it does**: Creates an SME review tracking issue when the `needs SME` label is applied to a PR or issue +# **Why we have it**: We do not want to manually create an SME review tracking issue when an SME review is needed +# **Who does it impact**: Hubbers + +on: + issues: + types: + - labeled + # Required in lieu of `pull_request` so that this workflow can query users in org to determine membership. + pull_request_target: + types: + - labeled + + pull_request: + types: + - labeled + +permissions: + contents: read + +jobs: + create-sme-review-tracking-issue: + runs-on: ubuntu-latest + if: github.repository == 'github/docs' && github.event.label.name == 'test-create-tracking-issue' + steps: + - id: create-issue + env: + URL: ${{ github.event.pull_request.html_url || github.event.issue.html_url }} + uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 + with: + github-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} + script: |- + + const issueNo = context.number || context.issue.number + + // Create an issue in docs-team repo + await github.rest.issues.create({ + owner: 'github', + repo: 'docs-team', + title: `SME tracking issue for \#${issueNo}`, + body: `### Issue / PR that requires an SME review + + ${process.env.URL} + + ### Location SME review was requested + + _Insert link to the location SME review was initially requested_ + + #### In the comments below, include notes regarding SME review progress (examples) - + + - Routed to another channel / team + - Reviewer stating they'll need to get back to us at a later time + - Review provided was unclear or missing key information, and a follow-up is necessary + `, + labels: ['on track','open source', 'sme-review'], + });