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.
Merge branch 'github:main' into main
- Loading branch information
Showing
1,110 changed files
with
85,202 additions
and
1,528,716 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
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
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
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
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
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,42 @@ | ||
name: All documents script | ||
|
||
# **What it does**: Verifies that the all-documents script works. | ||
# **Why we have it**: Code quality and sustainability. | ||
# **Who does it impact**: docs-engineering | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'src/content-render/scripts/all-documents/**' | ||
- 'package*.json' | ||
- .github/workflows/all-documents.yml | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
all-documents-script: | ||
if: github.repository == 'github/docs-internal' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: ./.github/actions/node-npm-setup | ||
|
||
- name: Run all-documents script | ||
env: | ||
NODE_ENV: production | ||
run: | | ||
echo "Help..." | ||
npm run all-documents -- --help | ||
echo "" | ||
echo "Storing in a file (English only)" | ||
npm run all-documents -- -o all-documents.json -l en | ||
echo "" | ||
echo "Look at the first 50 lines of the file..." | ||
cat all-documents.json | jq | head -n 50 | ||
# We're essentially expecting it to not crash and fail. |
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
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
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
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,40 @@ | ||
name: Close dangling PRs | ||
|
||
# **What it does**: Searches for specific PRs that have been open for a certain number of days and closes them. | ||
# **Why we have it**: Tidying up so humans don't need to do it. | ||
# **Who does it impact**: docs-engineering | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '20 16 * * *' # Run every day at 16:20 UTC / 8:20 PST | ||
pull_request: | ||
paths: | ||
- .github/workflows/close-dangling-prs.yml | ||
- src/workflows/close-dangling-prs.ts | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
close-dangling-prs: | ||
if: github.repository == 'github/docs-internal' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: ./.github/actions/node-npm-setup | ||
|
||
- name: Close dangling PRs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }} | ||
DRY_RUN: ${{ github.event_name == 'pull_request'}} | ||
run: npm run close-dangling-prs | ||
|
||
- uses: ./.github/actions/slack-alert | ||
if: ${{ failure() && github.event_name == 'schedule' }} | ||
with: | ||
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} | ||
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} |
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
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
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
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,65 @@ | ||
name: Don't delete features | ||
|
||
# **What it does**: | ||
# If the PR (against main) involves deletion of features, if any of | ||
# them are deletions or renames, post a comment, and ultimately | ||
# fail the check. | ||
# **Why we have it**: | ||
# If you delete the reference to an image, the English content is fine | ||
# because it no longer tries to use the feature that doesn't exist. | ||
# But this is not the case for translations. | ||
# **Who does it impact**: Docs content. | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'data/features/**' | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
dont-delete-features: | ||
# It's 'docs-bot' that creates those PR from "Delete orphaned features" | ||
if: github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: ./.github/actions/node-npm-setup | ||
|
||
- name: Get comment markdown | ||
id: comment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npm run deleted-features-pr-comment | ||
|
||
- name: Find possible previous comment | ||
if: ${{ steps.comment.outputs.markdown != '' }} | ||
uses: peter-evans/find-comment@d5fe37641ad8451bdd80312415672ba26c86575e | ||
id: findComment | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: '<!-- DELETED_FEATURES -->' | ||
|
||
- name: Update comment | ||
if: ${{ steps.comment.outputs.markdown != '' }} | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 | ||
with: | ||
comment-id: ${{ steps.findComment.outputs.comment-id }} | ||
issue-number: ${{ github.event.number }} | ||
body: ${{ steps.comment.outputs.markdown }} | ||
edit-mode: replace | ||
|
||
- name: Ultimately fail the workflow for attention | ||
if: ${{ steps.comment.outputs.markdown != '' }} | ||
run: | | ||
echo "More than 1 feature was deleted as part of this PR." | ||
echo "See posted PR commented about how to get them back." | ||
exit 1 |
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
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
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,52 @@ | ||
name: Index autocomplete Elasticsearch | ||
|
||
# **What it does**: Indexes autocomplete data into Elasticsearch. | ||
# **Why we have it**: So we can power the API for autocomplete. | ||
# **Who does it impact**: docs-engineering | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '20 16 * * *' # Run every day at 16:20 UTC / 8:20 PST | ||
pull_request: | ||
paths: | ||
- .github/workflows/index-autocomplete-elasticsearch.yml | ||
- 'src/search/scripts/index/**' | ||
- 'package*.json' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
index-autocomplete-elasticsearch: | ||
if: ${{ github.repository == 'github/docs-internal' }} | ||
runs-on: ubuntu-20.04-xl | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: ./.github/actions/node-npm-setup | ||
|
||
- uses: ./.github/actions/setup-elasticsearch | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }} | ||
repository: github/docs-internal-data | ||
path: docs-internal-data | ||
|
||
- name: Check that Elasticsearch is accessible | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: curl --fail --retry-connrefused --retry 5 -I http://localhost:9200 | ||
|
||
- name: Run indexing | ||
env: | ||
ELASTICSEARCH_URL: ${{ github.event_name == 'pull_request' && 'http://localhost:9200' || secrets.ELASTICSEARCH_URL }} | ||
run: npm run index -- autocomplete docs-internal-data | ||
|
||
- uses: ./.github/actions/slack-alert | ||
if: ${{ failure() && github.event_name == 'schedule' }} | ||
with: | ||
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} | ||
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} |
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
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
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
Oops, something went wrong.