Merge branch 'main' into patch-1
|
@ -1,6 +1,3 @@
|
|||
ALGOLIA_API_KEY=
|
||||
ALGOLIA_APPLICATION_ID=
|
||||
ALLOW_TRANSLATION_COMMITS=
|
||||
EARLY_ACCESS_HOSTNAME=
|
||||
EARLY_ACCESS_SHARED_SECRET=
|
||||
GITHUB_TOKEN=
|
|
@ -20,6 +20,10 @@ package.json @github/docs-engineering
|
|||
# Site Policy
|
||||
/content/github/site-policy/ @github/site-policy-admins
|
||||
|
||||
# Content strategy
|
||||
/contributing/content-markup-reference.md @github/docs-content-strategy
|
||||
/contributing/content-style-guide.md @github/docs-content-strategy
|
||||
|
||||
# Make sure that Octokit maintainers get notified about changes
|
||||
# relevant to the Octokit libraries (https://github.com/octokit)
|
||||
/content/rest/reference @github/octokit-maintainers
|
||||
|
|
|
@ -7,13 +7,13 @@ labels:
|
|||
assignees: ''
|
||||
---
|
||||
<!--
|
||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
|
||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
|
||||
-->
|
||||
|
||||
<!--
|
||||
For questions, ask in Discussions: https://github.com/github/docs/discussions
|
||||
|
||||
Before you file an issue read the:
|
||||
Before you file an issue read the:
|
||||
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
|
||||
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@ assignees: ''
|
|||
---
|
||||
|
||||
<!--
|
||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
|
||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
|
||||
-->
|
||||
|
||||
<!--
|
||||
For questions, ask in Discussions: https://github.com/github/docs/discussions
|
||||
|
||||
Before you file an issue read the:
|
||||
Before you file an issue read the:
|
||||
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
|
||||
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md
|
||||
|
||||
|
|
|
@ -24,13 +24,14 @@ module.exports = [
|
|||
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
|
||||
'pascalgn/automerge-action@c9bd182',
|
||||
'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
|
||||
'peter-evans/create-or-update-project-card@80140aaeb9730972a83c626031250621fe8f6670',
|
||||
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
|
||||
'peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd',
|
||||
'peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43',
|
||||
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
|
||||
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
|
||||
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
|
||||
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
|
||||
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
|
||||
'someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd',
|
||||
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
|
||||
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575'
|
||||
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575',
|
||||
'dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58'
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ jobs:
|
|||
- name: Run script
|
||||
run: |
|
||||
script/check-english-links.js > broken_links.md
|
||||
echo -e '\ncc @github/docs-content'>> broken_links.md
|
||||
- if: ${{ failure() }}
|
||||
name: Get title for issue
|
||||
id: check
|
||||
|
@ -28,7 +27,7 @@ jobs:
|
|||
name: Close previous report
|
||||
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
|
||||
with:
|
||||
query: 'label:"broken+link+report"'
|
||||
query: 'label:"broken link report"'
|
||||
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
- if: ${{ failure() }}
|
||||
name: Create issue from file
|
||||
|
@ -40,11 +39,10 @@ jobs:
|
|||
content-filepath: ./broken_links.md
|
||||
labels: broken link report
|
||||
- if: ${{ failure() }}
|
||||
name: Add issue to FR project board
|
||||
uses: peter-evans/create-or-update-project-card@80140aaeb9730972a83c626031250621fe8f6670
|
||||
name: Add comment to issue
|
||||
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
|
||||
with:
|
||||
project-repository: 'github'
|
||||
project-number: '1367'
|
||||
column-name: 'Docs-content FR issues'
|
||||
body: |
|
||||
cc @github/docs-content
|
||||
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
|
||||
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
|
|
|
@ -2,6 +2,9 @@ name: CodeQL analysis
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
pull_request:
|
||||
branches: main
|
||||
paths:
|
||||
- '**/*.js'
|
||||
- '.github/workflows/codeql.yml'
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
name: Confirm internal staff meant to post in public
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- transferred
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
check-team-membership:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
if: github.repository == 'github/docs'
|
||||
steps:
|
||||
- id: membership_check
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
script: |
|
||||
// Only perform this action with GitHub employees
|
||||
try {
|
||||
await github.teams.getMembershipForUserInOrg({
|
||||
org: 'github',
|
||||
team_slug: 'employees',
|
||||
username: context.payload.sender.login,
|
||||
});
|
||||
} catch(err) {
|
||||
// An error will be thrown if the user is not a GitHub employee
|
||||
// If a user is not a GitHub employee, we should stop here and
|
||||
// Not send a notification
|
||||
return
|
||||
}
|
||||
|
||||
// Don't perform this action with Docs team members
|
||||
try {
|
||||
await github.teams.getMembershipForUserInOrg({
|
||||
org: 'github',
|
||||
team_slug: 'docs',
|
||||
username: context.payload.sender.login,
|
||||
});
|
||||
// If the user is a Docs team member, we should stop here and not send
|
||||
// a notification
|
||||
return
|
||||
} catch(err) {
|
||||
// An error will be thrown if the user is not a Docs team member
|
||||
// If a user is not a Docs team member we should continue and send
|
||||
// the notification
|
||||
}
|
||||
|
||||
const issueNo = context.number || context.issue.number
|
||||
|
||||
// Create an issue in our private repo
|
||||
await github.issues.create({
|
||||
owner: 'github',
|
||||
repo: 'docs-internal',
|
||||
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
|
||||
body: `@${context.payload.sender.login} opened https://github.com/github/docs/issues/${issueNo} publicly in the github/docs repo, instead of the private github/docs-internal repo.\n\n@${context.payload.sender.login}, please confirm that this belongs in the public repo and that no sensitive information was disclosed by commenting below and closing the issue.\n\nIf this was not intentional and sensitive information was shared, please delete https://github.com/github/docs/issues/${issueNo} and notify us in the \#docs-open-source channel.\n\nThanks! \n\n/cc @github/docs @github/docs-engineering`
|
||||
});
|
||||
|
||||
core.setOutput('did_warn', 'true')
|
||||
|
||||
- name: Send Slack notification if a GitHub employee who isn't on the docs team opens an issue in public
|
||||
if: ${{ steps.membership_check.outputs.did_warn && github.repository == 'github/docs' }}
|
||||
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of the private github/docs-internal repo. They have been notified via a new issue in the github/docs-internal repo to confirm this was intentional.
|
|
@ -10,23 +10,8 @@ on:
|
|||
- translations
|
||||
|
||||
jobs:
|
||||
see_if_should_skip:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
|
||||
with:
|
||||
cancel_others: 'false'
|
||||
github_token: ${{ github.token }}
|
||||
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml", ".eslint*"]'
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: see_if_should_skip
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
|
|
@ -10,6 +10,11 @@ jobs:
|
|||
if: github.event.pull_request.user.login == 'github-openapi-bot'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label pull requests with 'github-openapi-bot'
|
||||
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
add-labels: 'github-openapi-bot'
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
- name: Remove script results file
|
||||
run: rm -rf ./results.md
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
||||
uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
|
||||
with:
|
||||
# need to use a token with repo and workflow scopes for this step
|
||||
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
|
|
|
@ -14,11 +14,10 @@ jobs:
|
|||
if: github.repository == 'github/docs-internal'
|
||||
steps:
|
||||
- name: Send Slack notification if repo is frozen
|
||||
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
|
||||
if: ${{ env.FREEZE == 'true' }}
|
||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||
SLACK_USERNAME: docs-repo-sync
|
||||
SLACK_ICON_EMOJI: ':freezing_face:'
|
||||
SLACK_COLOR: '#51A0D5' # Carolina Blue
|
||||
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
color: info
|
||||
text: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
name: Repo Sync Stalls
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 */2 * * *'
|
||||
jobs:
|
||||
check-freezer:
|
||||
name: Check for deployment freezes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Exit if repo is frozen
|
||||
if: ${{ env.FREEZE == 'true' }}
|
||||
run: |
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
repo-sync-stalls:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if repo sync is stalled
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
script: |
|
||||
let pulls;
|
||||
const owner = context.repo.owner
|
||||
const repo = context.repo.repo
|
||||
try {
|
||||
pulls = await github.pulls.list({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
head: `${owner}:repo-sync`,
|
||||
state: 'open'
|
||||
});
|
||||
} catch(err) {
|
||||
throw err
|
||||
return
|
||||
}
|
||||
|
||||
pulls.data.forEach(pr => {
|
||||
const timeDelta = Date.now() - Date.parse(pr.created_at);
|
||||
const minutesOpen = timeDelta / 1000 / 60;
|
||||
|
||||
if (minutesOpen > 180) {
|
||||
core.setFailed('Repo sync appears to be stalled')
|
||||
}
|
||||
})
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
|
||||
if: failure()
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
color: failure
|
||||
text: Repo sync appears to be stalled for ${{github.repository}}. See https://github.com/${{github.repository}}/pulls?q=is%3Apr+is%3Aopen+repo+sync
|
|
@ -7,6 +7,7 @@
|
|||
name: Repo Sync
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '*/15 * * * *' # every 15 minutes
|
||||
|
||||
|
@ -43,6 +44,7 @@ jobs:
|
|||
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
|
||||
- name: Create pull request
|
||||
id: create-pull
|
||||
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
|
@ -51,7 +53,7 @@ jobs:
|
|||
destination_branch: main
|
||||
pr_title: 'repo sync'
|
||||
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
|
||||
pr_label: automerge,autoupdate
|
||||
pr_label: automerge,autoupdate,automated-reposync-pr
|
||||
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
|
||||
- name: Find pull request
|
||||
|
@ -69,12 +71,40 @@ jobs:
|
|||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.find-pull-request.outputs.number }}
|
||||
|
||||
# There are cases where the branch becomes out-of-date in between the time this workflow began and when the pull request is created/updated
|
||||
- name: Update branch
|
||||
if: ${{ steps.find-pull-request.outputs.number }}
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const mainHeadSha = await github.git.getRef({
|
||||
...context.repo,
|
||||
ref: 'heads/main'
|
||||
})
|
||||
console.log(`heads/main sha: ${mainHeadSha.data.object.sha}`)
|
||||
|
||||
const pull = await github.pulls.get({
|
||||
...context.repo,
|
||||
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
|
||||
})
|
||||
console.log(`Pull request base sha: ${pull.data.base.sha}`)
|
||||
|
||||
if (mainHeadSha.data.object.sha !== pull.data.base.sha || pull.data.mergeable_state === 'behind') {
|
||||
const updateBranch = await github.pulls.updateBranch({
|
||||
...context.repo,
|
||||
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
|
||||
})
|
||||
console.log(updateBranch.data.message)
|
||||
} else {
|
||||
console.log(`Branch is already up-to-date`)
|
||||
}
|
||||
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||
SLACK_USERNAME: docs-repo-sync
|
||||
SLACK_ICON_EMOJI: ':ohno:'
|
||||
SLACK_COLOR: '#B90E0A' # Crimson
|
||||
SLACK_MESSAGE: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22
|
||||
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
|
||||
if: failure()
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
color: failure
|
||||
text: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22
|
||||
|
|
|
@ -33,8 +33,10 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: npm run sync-search
|
||||
- name: Send slack notification if workflow run fails
|
||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
|
||||
if: failure()
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. See https://github.com/github/docs-internal/actions?query=workflow%3AAlgolia
|
||||
with:
|
||||
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
||||
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|
||||
color: failure
|
||||
text: The last Algolia workflow run for ${{github.repository}} failed. Search actions for `workflow:Algolia`
|
||||
|
|
|
@ -27,7 +27,7 @@ jobs:
|
|||
with:
|
||||
cancel_others: 'false'
|
||||
github_token: ${{ github.token }}
|
||||
paths: '[".github/workflows/test.yml",".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
|
||||
paths: '[".github/workflows/test.yml", ".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
|
||||
|
||||
test:
|
||||
needs: see_if_should_skip
|
||||
|
@ -36,13 +36,17 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
test-group:
|
||||
[content, meta, rendering, routing, unit, links-and-images, graphql]
|
||||
steps:
|
||||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
|
||||
# Even if if doesn't do anything
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Check out repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
with:
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Setup node
|
||||
|
@ -69,8 +73,15 @@ jobs:
|
|||
name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Run build script
|
||||
- name: Clone early access
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
|
||||
run: npm run heroku-postbuild
|
||||
env:
|
||||
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
GIT_BRANCH: ${{ github.ref }}
|
||||
|
||||
- name: Run build script
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
|
||||
run: npm run build
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
|
@ -78,10 +89,3 @@ jobs:
|
|||
run: npx jest tests/${{ matrix.test-group }}/
|
||||
env:
|
||||
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||
if: failure() && github.ref == 'early-access'
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||
SLACK_MESSAGE: 'Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access'
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
name: Check unallowed file changes
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
paths:
|
||||
- '.github/workflows/**'
|
||||
- '.github/CODEOWNERS'
|
||||
- 'translations/**'
|
||||
- 'assets/fonts/**'
|
||||
- 'data/graphql/**'
|
||||
- 'lib/graphql/**'
|
||||
- 'lib/redirects/**'
|
||||
- 'lib/rest/**'
|
||||
- 'lib/webhooks/**'
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: Check for existing requested changes
|
||||
id: requested-change
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
result-encoding: json
|
||||
script: |
|
||||
const pullReviews = await github.pulls.listReviews({
|
||||
...context.repo,
|
||||
pull_number: context.payload.number
|
||||
})
|
||||
|
||||
const botReviews = pullReviews.data
|
||||
.filter(review => review.user.login === 'github-actions[bot]')
|
||||
.sort((a, b) => new Date(b.submitted_at) - new Date(a.submitted_at))
|
||||
.shift()
|
||||
|
||||
if (botReviews) {
|
||||
console.log(`Pull request reviews authored by the github-action bot: ${botReviews}`)
|
||||
}
|
||||
return botReviews
|
||||
|
||||
- name: Get files changed
|
||||
uses: dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58
|
||||
id: filter
|
||||
with:
|
||||
# Base branch used to get changed files
|
||||
base: 'main'
|
||||
|
||||
# Enables setting an output in the format in `${FILTER_NAME}_files
|
||||
# with the names of the matching files formatted as JSON array
|
||||
list-files: json
|
||||
|
||||
# Returns list of changed files matching each filter
|
||||
filters: |
|
||||
translation:
|
||||
- 'translations/**'
|
||||
openapi:
|
||||
- 'lib/rest/static/**'
|
||||
notAllowed:
|
||||
- '.github/workflows/**'
|
||||
- '.github/CODEOWNERS'
|
||||
- 'translations/**'
|
||||
- 'assets/fonts/**'
|
||||
- 'data/graphql/**'
|
||||
- 'lib/graphql/**'
|
||||
- 'lib/redirects/**'
|
||||
- 'lib/rest/**'
|
||||
- 'lib/webhooks/**'
|
||||
|
||||
# When there are changes to files we can't accept
|
||||
# and no review exists,leave a REQUEST_CHANGES review
|
||||
- name: Request pull request changes
|
||||
# Check for no reviews or reviews that aren't CHANGES_REQUESTED
|
||||
if: ${{ steps.filter.outputs.notAllowed == 'true' && (!steps.requested-change.outputs.result || fromJson(steps.requested-change.outputs.result).state != 'CHANGES_REQUESTED') }}
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const changedFiles = ${{steps.filter.outputs.notAllowed_files}}
|
||||
const restFiles = ${{steps.filter.outputs.openapi_files}}
|
||||
const translationFiles = ${{steps.filter.outputs.translation_files}}
|
||||
const markdownFiles = changedFiles.map(file => `- \`${file}\`\n`).join('')
|
||||
|
||||
let reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions.\n${markdownFiles}\n\nYou'll need to revert all of these ☝️ files using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/reverting-a-commit) or \`git checkout origin/main <file name>\`. Once you get those files reverted, we can continue with the review process. :octocat:`
|
||||
|
||||
if (restFiles.length > 0) {
|
||||
reviewMessage += "\n\nIt looks like you've modified the OpenAPI schema (`lib/rest/static/**`). While we aren't accepting changes to the schema directly, you can open an issue for any updates to the REST API docs. Head on over to the [`github/rest-api-description`](https://github.com/github/rest-api-description/issues/new?assignees=&labels=Inaccuracy&template=schema-inaccuracy.md&title=%5BSchema+Inaccuracy%5D+%3CDescribe+Problem%3E) repository to open an issue. ⚡"
|
||||
}
|
||||
|
||||
if (translationFiles.length > 0) {
|
||||
await github.issues.addLabels({
|
||||
...context.repo,
|
||||
issue_number: context.payload.number,
|
||||
labels: ['localization']
|
||||
})
|
||||
reviewMessage += "\n\nIt looks like you've modified translated content. Unfortunately, we are not able to accept pull requests for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open source community, but we're not there yet. See https://github.com/github/docs/blob/main/CONTRIBUTING.md#earth_asia-translations for more details."
|
||||
}
|
||||
|
||||
await github.pulls.createReview({
|
||||
...context.repo,
|
||||
pull_number: context.payload.number,
|
||||
body: reviewMessage,
|
||||
event: 'REQUEST_CHANGES'
|
||||
})
|
||||
# When the most recent review was CHANGES_REQUESTED and the existing
|
||||
# PR no longer contains unallowed changes, dismiss the previous review
|
||||
- name: Dismiss pull request review
|
||||
# Check that unallowed files aren't modified and that a
|
||||
# CHANGES_REQUESTED review already exists
|
||||
if: ${{ steps.filter.outputs.notAllowed == 'false' && steps.requested-change.outputs.result && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }}
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
await github.pulls.dismissReview({
|
||||
...context.repo,
|
||||
pull_number: context.payload.number,
|
||||
review_id: ${{fromJson(steps.requested-change.outputs.result).id}},
|
||||
message: `✨Looks like you reverted all files we don't accept contributions for. 🙌 A member of the docs team will review your PR soon. 🚂`
|
||||
})
|
|
@ -9,6 +9,7 @@ env:
|
|||
FREEZE: ${{ secrets.FREEZE }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '20 16 * * *' # run every day at 16:20 UTC / 8:20 PST
|
||||
|
||||
|
@ -36,21 +37,16 @@ jobs:
|
|||
- name: Run updater scripts
|
||||
env:
|
||||
# need to use a token from a user with access to github/github for this step
|
||||
GITHUB_TOKEN: ${{ secrets.ZEKE_PAT_WITH_REPO_AND_WORKFLOW_SCOPE_FOR_REPO_SYNC }}
|
||||
# technically the changelog should only be updated once per day, but we can safely
|
||||
# run build-changelog-from-markdown.js in its current form once per hour; when we
|
||||
# rewrite the changelog script, we may need to run it in a separate workflow on a
|
||||
# once-per-day schedule; see details in https://github.com/github/docs-internal/issues/12722.
|
||||
GITHUB_TOKEN: ${{ secrets.RACHMARI_REPO_WORKFLOW }}
|
||||
run: |
|
||||
script/graphql/update-files.js
|
||||
script/graphql/build-changelog-from-markdown.js
|
||||
- name: Create pull request
|
||||
id: create-pull-request
|
||||
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8
|
||||
uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
|
||||
with:
|
||||
# need to use a token with repo and workflow scopes for this step
|
||||
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
commit-message: 'Action ran graphql scripts "update-files" and "build-changelog-from-markdown"'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'Action ran graphql script"update-files"'
|
||||
title: GraphQL schema update
|
||||
body:
|
||||
"Hello! Some GraphQL data in github/github was updated recently. This PR
|
||||
|
|
|
@ -10,23 +10,8 @@ on:
|
|||
- translations
|
||||
|
||||
jobs:
|
||||
see_if_should_skip:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
|
||||
with:
|
||||
cancel_others: 'false'
|
||||
github_token: ${{ github.token }}
|
||||
paths: '["**/*.yml", "**/*.yaml", "package*.json", ".github/workflows/yml-lint.yml"]'
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: see_if_should_skip
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
.algolia-cache
|
||||
.DS_Store
|
||||
.env
|
||||
node_modules
|
||||
/node_modules/
|
||||
npm-debug.log
|
||||
coverage
|
||||
coverage/
|
||||
.linkinator
|
||||
broken_links.md
|
||||
/assets/images/early-access
|
||||
/content/early-access
|
||||
/data/early-access
|
||||
dist
|
||||
|
||||
# blc: broken link checker
|
||||
blc_output.log
|
||||
blc_output_internal.log
|
||||
/dist/
|
||||
broken_links.md
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Node: Nodemon",
|
||||
"processId": "${command:PickProcess}",
|
||||
"restart": true,
|
||||
"protocol": "inspector",
|
||||
},
|
||||
]
|
||||
}
|
|
@ -152,7 +152,7 @@ We (usually the docs team, but sometimes GitHub product managers, engineers, or
|
|||
You should always review your own PR first.
|
||||
|
||||
For content changes, make sure that you:
|
||||
- [ ] Confirm that the changes address every part of the content strategy plan from your issue (if there are differences, explain them).
|
||||
- [ ] Confirm that the changes address every part of the content design plan from your issue (if there are differences, explain them).
|
||||
- [ ] Review the content for technical accuracy.
|
||||
- [ ] Review the entire pull request using the [localization checklist](contributing/localization-checklist.md).
|
||||
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the style guide.
|
||||
|
|
|
@ -10,10 +10,11 @@ GEM
|
|||
|
||||
PLATFORMS
|
||||
ruby
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
graphql (= 1.10.6)
|
||||
graphql-schema_comparator (~> 1.0.0)
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
2.2.1
|
||||
|
|
|
@ -28,7 +28,7 @@ If you've found a problem, you can open an issue using a [template](https://gith
|
|||
|
||||
#### Solve an issue
|
||||
|
||||
If you have a solution to one of the open issues, you will need to fork the repository and submit a PR using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
|
||||
If you have a solution to one of the open issues, you will need to fork the repository and submit a pull request using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
|
||||
|
||||
#### Join us in discussions
|
||||
|
||||
|
@ -50,6 +50,8 @@ There are a few more things to know when you're getting started with this repo:
|
|||
In addition to the README you're reading right now, this repo includes other READMEs that describe the purpose of each subdirectory in more detail:
|
||||
|
||||
- [content/README.md](content/README.md)
|
||||
- [content/graphql/README.md](content/graphql/README.md)
|
||||
- [content/rest/README.md](content/rest/README.md)
|
||||
- [contributing/README.md](contributing/README.md)
|
||||
- [data/README.md](data/README.md)
|
||||
- [data/reusables/README.md](data/reusables/README.md)
|
||||
|
|
3
app.json
|
@ -2,7 +2,8 @@
|
|||
"name": "docs.github.com",
|
||||
"env": {
|
||||
"NODE_ENV": "production",
|
||||
"NPM_CONFIG_PRODUCTION": "true"
|
||||
"NPM_CONFIG_PRODUCTION": "true",
|
||||
"ENABLED_LANGUAGES": "en"
|
||||
},
|
||||
"buildpacks": [
|
||||
{ "url": "heroku/nodejs" }
|
||||
|
|
После Ширина: | Высота: | Размер: 89 KiB |
После Ширина: | Высота: | Размер: 52 KiB |
После Ширина: | Высота: | Размер: 147 KiB |
После Ширина: | Высота: | Размер: 164 KiB |
После Ширина: | Высота: | Размер: 76 KiB |
После Ширина: | Высота: | Размер: 175 KiB |
Двоичные данные
assets/images/help/classroom/assignment-repository-ide-button-in-readme.png
Normal file
После Ширина: | Высота: | Размер: 28 KiB |
После Ширина: | Высота: | Размер: 83 KiB |
После Ширина: | Высота: | Размер: 32 KiB |
Двоичные данные
assets/images/help/classroom/assignments-autograding-click-pencil-or-trash.png
Normal file
После Ширина: | Высота: | Размер: 28 KiB |
Двоичные данные
assets/images/help/classroom/assignments-choose-repository-visibility.png
Normal file
После Ширина: | Высота: | Размер: 72 KiB |
После Ширина: | Высота: | Размер: 20 KiB |
Двоичные данные
assets/images/help/classroom/assignments-click-create-assignment-button.png
Normal file
После Ширина: | Высота: | Размер: 24 KiB |
После Ширина: | Высота: | Размер: 76 KiB |
Двоичные данные
assets/images/help/classroom/assignments-click-new-assignment-button.png
Normal file
После Ширина: | Высота: | Размер: 53 KiB |
После Ширина: | Высота: | Размер: 134 KiB |
После Ширина: | Высота: | Размер: 78 KiB |
После Ширина: | Высота: | Размер: 19 KiB |
Двоичные данные
assets/images/help/classroom/assignments-click-save-test-case-button.png
Normal file
После Ширина: | Высота: | Размер: 21 KiB |
Двоичные данные
assets/images/help/classroom/assignments-click-template-repository-in-list.png
Normal file
После Ширина: | Высота: | Размер: 121 KiB |
После Ширина: | Высота: | Размер: 21 KiB |
После Ширина: | Высота: | Размер: 77 KiB |
После Ширина: | Высота: | Размер: 96 KiB |
После Ширина: | Высота: | Размер: 71 KiB |
Двоичные данные
assets/images/help/classroom/assignments-enable-feedback-pull-requests.png
Normal file
После Ширина: | Высота: | Размер: 39 KiB |
После Ширина: | Высота: | Размер: 40 KiB |
После Ширина: | Высота: | Размер: 330 KiB |
После Ширина: | Высота: | Размер: 187 KiB |
После Ширина: | Высота: | Размер: 95 KiB |
После Ширина: | Высота: | Размер: 58 KiB |
После Ширина: | Высота: | Размер: 58 KiB |
После Ширина: | Высота: | Размер: 168 KiB |
После Ширина: | Высота: | Размер: 154 KiB |
После Ширина: | Высота: | Размер: 166 KiB |
После Ширина: | Высота: | Размер: 181 KiB |
Двоичные данные
assets/images/help/classroom/classroom-settings-click-connection-settings.png
Normal file
После Ширина: | Высота: | Размер: 48 KiB |
Двоичные данные
assets/images/help/classroom/classroom-settings-click-disconnect-from-your-lms-button.png
Normal file
После Ширина: | Высота: | Размер: 94 KiB |
После Ширина: | Высота: | Размер: 148 KiB |
После Ширина: | Высота: | Размер: 149 KiB |
После Ширина: | Высота: | Размер: 52 KiB |
После Ширина: | Высота: | Размер: 50 KiB |
После Ширина: | Высота: | Размер: 30 KiB |
После Ширина: | Высота: | Размер: 78 KiB |
Двоичные данные
assets/images/help/classroom/click-import-from-a-learning-management-system-button.png
Normal file
После Ширина: | Высота: | Размер: 61 KiB |
После Ширина: | Высота: | Размер: 52 KiB |
После Ширина: | Высота: | Размер: 83 KiB |
После Ширина: | Высота: | Размер: 28 KiB |
После Ширина: | Высота: | Размер: 30 KiB |
После Ширина: | Высота: | Размер: 60 KiB |
Двоичные данные
assets/images/help/classroom/delete-classroom-click-delete-classroom-button.png
Normal file
После Ширина: | Высота: | Размер: 127 KiB |
После Ширина: | Высота: | Размер: 104 KiB |
Двоичные данные
assets/images/help/classroom/ide-makecode-arcade-version-control-button.png
Normal file
После Ширина: | Высота: | Размер: 264 KiB |
После Ширина: | Высота: | Размер: 69 KiB |
После Ширина: | Высота: | Размер: 234 KiB |
После Ширина: | Высота: | Размер: 955 KiB |
После Ширина: | Высота: | Размер: 113 KiB |
После Ширина: | Высота: | Размер: 40 KiB |
После Ширина: | Высота: | Размер: 41 KiB |
После Ширина: | Высота: | Размер: 140 KiB |
После Ширина: | Высота: | Размер: 102 KiB |
После Ширина: | Высота: | Размер: 163 KiB |
Двоичные данные
assets/images/help/classroom/students-click-delete-roster-button-in-modal.png
Normal file
После Ширина: | Высота: | Размер: 324 KiB |
После Ширина: | Высота: | Размер: 91 KiB |
После Ширина: | Высота: | Размер: 48 KiB |
После Ширина: | Высота: | Размер: 174 KiB |
После Ширина: | Высота: | Размер: 83 KiB |
После Ширина: | Высота: | Размер: 45 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 55 KiB |
После Ширина: | Высота: | Размер: 57 KiB |
После Ширина: | Высота: | Размер: 60 KiB |
После Ширина: | Высота: | Размер: 65 KiB |
После Ширина: | Высота: | Размер: 69 KiB |
После Ширина: | Высота: | Размер: 353 KiB |
После Ширина: | Высота: | Размер: 41 KiB |