|
53 | 53 | type: boolean
|
54 | 54 | default: false
|
55 | 55 | required: false
|
| 56 | + enable-cumulative-comment: |
| 57 | + description: 'Enable info comment' |
| 58 | + type: boolean |
| 59 | + default: false |
| 60 | + required: false |
56 | 61 |
|
57 | 62 | permissions:
|
58 | 63 | contents: read
|
@@ -463,6 +468,7 @@ jobs:
|
463 | 468 | ALL_CHANGED_FILES: ${{ needs.check.outputs.all_changed_files }}
|
464 | 469 | PATH_PREFIX: ${{ needs.build.outputs.path_prefix }}
|
465 | 470 | with:
|
| 471 | + # language=javascript |
466 | 472 | script: |
|
467 | 473 | const title = '## π Preview links for changed docs'
|
468 | 474 | const changedMdFiles = process.env.ALL_CHANGED_FILES
|
@@ -530,3 +536,58 @@ jobs:
|
530 | 536 | body:body.join('\n'),
|
531 | 537 | });
|
532 | 538 | }
|
| 539 | + - name: Comment on docs changes about versioning requirements |
| 540 | + if: inputs.enable-cumulative-comment == 'true' |
| 541 | + uses: actions/github-script@v7 |
| 542 | + with: |
| 543 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 544 | + # language=javascript |
| 545 | + script: | |
| 546 | + const pr = context.payload.pull_request; |
| 547 | + const prNum = pr.number; |
| 548 | + const owner = context.repo.owner; |
| 549 | + const repo = context.repo.repo; |
| 550 | + |
| 551 | + |
| 552 | + const { data: comments } = await github.rest.issues.listComments({ |
| 553 | + owner, repo, issue_number: prNum |
| 554 | + }); |
| 555 | + |
| 556 | + const title = '## βΉοΈ Important: Docs version tagging'; |
| 557 | + |
| 558 | + const existingComment = comments.find(c => |
| 559 | + c.user.type === 'Bot' && |
| 560 | + c.body.startsWith(title) |
| 561 | + ); |
| 562 | + |
| 563 | + if (existingComment) return; |
| 564 | + |
| 565 | + const body = `${title} |
| 566 | +
|
| 567 | + π Thanks for updating the docs! Just a friendly reminder that our docs are now **cumulative**. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. |
| 568 | + |
| 569 | + We use [applies_to tags](https://elastic.github.io/docs-builder/syntax/applies) to mark version-specific features and changes. |
| 570 | + |
| 571 | + <details> |
| 572 | + <summary>Expand for a quick overview</summary> |
| 573 | + |
| 574 | + ### When to use applies_to tags: |
| 575 | + β
At the page level to indicate which products/deployments the content applies to (mandatory) |
| 576 | + β
When features change state (e.g. preview, ga) in a specific version |
| 577 | + β
When availability differs across deployments and environments |
| 578 | + |
| 579 | + ### What NOT to do: |
| 580 | + β Don't remove or replace information that applies to an older version |
| 581 | + β Don't add new information that applies to a specific version without an applies_to tag |
| 582 | + β Don't forget that applies_to tags can be used at the page, section, and inline level |
| 583 | + </details> |
| 584 | + |
| 585 | + ### π€ Need help? |
| 586 | + - Check out the [cumulative docs guidelines](https://elastic.github.io/docs-builder/contribute/cumulative-docs/) |
| 587 | + - Reach out in the [#docs](https://elastic.slack.com/archives/C0JF80CJZ) Slack channel`; |
| 588 | + |
| 589 | + await github.rest.issues.createComment({ |
| 590 | + owner, repo, |
| 591 | + issue_number: prNum, |
| 592 | + body |
| 593 | + }); |
0 commit comments