diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5d5b6e9dd..43efc70d4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,20 @@ ### Describe your changes. + This pull request... +### Does this pull request make any user interface changes? If so please describe. + +The user interface changes are... + +Those are reflected in updates to the documentation in ... + + ### What does your pull request address? Tag relevant issues. + This pull request addresses GH-... ### Tag relevant team members. + @User... diff --git a/.github/workflows/create-docs-pr.yml b/.github/workflows/create-docs-pr.yml index 4feb6b3a7..fe8d5f821 100644 --- a/.github/workflows/create-docs-pr.yml +++ b/.github/workflows/create-docs-pr.yml @@ -5,20 +5,27 @@ # `documentation-gitbook` is behind Open A PR from `documentation-gitbook` into `main` Determine the directionality, if wrong dismiss and open a PR from `documentation-gitbook` into `main` Dismiss the PR from `main` into `documentation-gitbook` # `documentation-gitbook` is ahead & behind Open 2 PRs Determine the directionality of the missing one and open that Nothing -name: create-docs-pr +name: Create GitBook Sync PRs on: workflow_dispatch: - schedule: - - cron: '1 10 * * 1-5' + pull_request: + types: + - closed + push: + branches: + - documentation-gitbook + paths: + - documentation/** jobs: - create-pr: + create-prs: runs-on: ubuntu-latest + if: github.event_name != 'pull_request' || (github.event.pull_request.merged == true && (github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'documentation-gitbook')) env: DOCS_BRANCH: documentation-gitbook PR_LABELS: 'documentation,high priority' - PR_ASSIGNEES: 'emprzy,jcblemai,pearsonca,saraloo,TimothyWillard' + PR_REVIEWERS: 'alsnhll,jcblemai,MacdonaldJoshuaCaleb,saraloo,shauntruelove,twallema' PR_TITLE: 'Sync GitBook' OWNER: 'HopkinsIDD' REPO: 'flepiMoP' @@ -42,17 +49,17 @@ jobs: result-encoding: string retries: 5 script: | - const { DOCS_AHEAD_MAIN, DOCS_BEHIND_MAIN, DOCS_BRANCH, PR_LABELS, PR_ASSIGNEES, PR_TITLE, OWNER, REPO } = process.env + const { DOCS_AHEAD_MAIN, DOCS_BEHIND_MAIN, DOCS_BRANCH, PR_LABELS, PR_REVIEWERS, PR_TITLE, OWNER, REPO } = process.env const prLabels = PR_LABELS.split(",") - const prAssignees = PR_ASSIGNEES.split(",") - const cc = prAssignees.map(x => "@" + x).join(", ") + const prReviewers = PR_REVIEWERS.split(",") + const cc = prReviewers.map(x => "@" + x).join(", ") const docsAheadMain = parseInt(DOCS_AHEAD_MAIN, 10) const docsBehindMain = parseInt(DOCS_BEHIND_MAIN, 10) if (isNaN(docsAheadMain) || isNaN(docsBehindMain)) { throw new Error(`Cannot convert either "${DOCS_AHEAD_MAIN}" or "${DOCS_BEHIND_MAIN}" to integers.`) } const initialResults = await github.rest.search.issuesAndPullRequests({ - q: `owner:${OWNER} repo:${REPO} is:open is:pr in:title '${PR_TITLE}'` + q: `repo:${OWNER}/${REPO} is:open is:pr in:title '${PR_TITLE}'` }) const count = initialResults.data.total_count if (count > 2) { @@ -89,11 +96,11 @@ jobs: issue_number: pr.data.number, labels: prLabels }) - github.rest.issues.addAssignees({ + github.rest.pulls.requestReviewers({ owner: OWNER, repo: REPO, - issue_number: pr.data.number, - assignees: prAssignees + pull_number: pr.data.number, + reviewers: prReviewers }) return pr.data.number }