Merge branch 'main' into codespaces
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -14,8 +14,8 @@ HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN I
|
||||
For questions, ask in Discussions: https://github.com/github/docs/discussions
|
||||
|
||||
Before you file an issue read the:
|
||||
- Code of Conduct: https://github.com/github/docs/blob/onboarding/CODE_OF_CONDUCT.md
|
||||
- Contributing guide: https://github.com/github/docs/blob/onboarding/CONTRIBUTING.md
|
||||
- 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
|
||||
|
||||
Check to make sure someone hasn't already opened a similar issue: https://github.com/github/docs/issues
|
||||
-->
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/improve-the-site.md
vendored
@@ -14,8 +14,8 @@ HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN I
|
||||
For questions, ask in Discussions: https://github.com/github/docs/discussions
|
||||
|
||||
Before you file an issue read the:
|
||||
- Code of Conduct: https://github.com/github/docs/blob/onboarding/CODE_OF_CONDUCT.md
|
||||
- Contributing guide: https://github.com/github/docs/blob/onboarding/CONTRIBUTING.md
|
||||
- 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
|
||||
|
||||
Check to make sure someone hasn't already opened a similar issue: https://github.com/github/docs/issues
|
||||
-->
|
||||
|
||||
20
.github/allowed-actions.js
vendored
@@ -4,17 +4,13 @@
|
||||
// can be added it this list.
|
||||
|
||||
module.exports = [
|
||||
'actions/cache@70655ec8323daeeaa7ef06d7c56e1b9191396cbe',
|
||||
'actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16',
|
||||
'actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675',
|
||||
'actions/github-script@5d03ada4b0a753e9460b312e61cc4f8fdeacf163',
|
||||
'actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45',
|
||||
'actions/github-script@44b873bc975058192f5279ebe7579496381f575d',
|
||||
'actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9',
|
||||
'actions/labeler@5f867a63be70efff62b767459b009290364495eb',
|
||||
'actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d',
|
||||
'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526',
|
||||
'actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8',
|
||||
'actions/cache@0781355a23dac32fd3bac414512f4b903437991a', //actions/cache@v2.1.3
|
||||
'actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f', //actions/checkout@v2.3.4
|
||||
'actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9', //actions/script@v3.0.0
|
||||
'actions/labeler@5f867a63be70efff62b767459b009290364495eb', //actions/labeler@v2.2.0
|
||||
'actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d', //actions/setup-node@v1.4.4
|
||||
'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526', //actions/setup-ruby@v1.1.2
|
||||
'actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4', //actions/stale@v3.0.13
|
||||
'crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688',
|
||||
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911',
|
||||
'docker://chinthakagodawita/autoupdate-action:v1',
|
||||
@@ -31,7 +27,7 @@ module.exports = [
|
||||
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
|
||||
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
|
||||
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
|
||||
'repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7',
|
||||
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
|
||||
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
|
||||
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
|
||||
]
|
||||
|
||||
2
.github/workflows/60-days-stale-check.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8
|
||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
|
||||
|
||||
12
.github/workflows/automerge-dependencies.yml
vendored
@@ -1,8 +1,16 @@
|
||||
name: Auto Merge Dependency Updates
|
||||
|
||||
on:
|
||||
- pull_request
|
||||
- pull_request_review
|
||||
pull_request:
|
||||
paths:
|
||||
- "package*.json"
|
||||
- "Gemfile*"
|
||||
- "Dockerfile"
|
||||
- ".github/workflows/**"
|
||||
pull_request_review:
|
||||
types:
|
||||
- edited
|
||||
- submitted
|
||||
|
||||
jobs:
|
||||
run:
|
||||
|
||||
14
.github/workflows/browser-test.yml
vendored
@@ -20,22 +20,18 @@ jobs:
|
||||
paths: '[".github/workflows/browser-test.yml","assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]'
|
||||
build:
|
||||
needs: see_if_should_skip
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
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: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- name: Checkout
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Install
|
||||
- name: Install
|
||||
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
||||
with:
|
||||
args: npm ci
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Test
|
||||
- name: Test
|
||||
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
|
||||
with:
|
||||
args: npm run browser-test
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
if: github.repository == 'github/docs-internal'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: npm run build
|
||||
|
||||
6
.github/workflows/codeql.yml
vendored
@@ -8,14 +8,10 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
|
||||
|
||||
2
.github/workflows/crowdin.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Sync
|
||||
uses: crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688
|
||||
|
||||
31
.github/workflows/dry-run-sync-algolia-search-indices.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: (Dry run) Algolia
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
updateIndices:
|
||||
name: (Dry run) Update indices
|
||||
if: github.repository == 'github/docs-internal'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
- name: cache node modules
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: (Dry run) sync indices
|
||||
env:
|
||||
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
|
||||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: npm run sync-search-dry-run
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check if the event originated from a team member
|
||||
uses: actions/github-script@44b873bc975058192f5279ebe7579496381f575d
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
id: set-result
|
||||
with:
|
||||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
||||
@@ -53,12 +53,12 @@ jobs:
|
||||
|
||||
first-responder-remove-pr:
|
||||
name: Remove PR from FR project board
|
||||
if: (github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled') || github.event.action == 'closed'
|
||||
if: github.repository == 'github/docs-internal' && ((github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled') || github.event.action == 'closed')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Remove card from project
|
||||
uses: actions/github-script@44b873bc975058192f5279ebe7579496381f575d
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
|
||||
result-encoding: string
|
||||
|
||||
59
.github/workflows/js-lint.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Lint JS
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- 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"]'
|
||||
|
||||
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
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npx standard
|
||||
|
||||
- name: Check dependencies
|
||||
run: npm run check-deps
|
||||
3
.github/workflows/merged-notification.yml
vendored
@@ -1,10 +1,11 @@
|
||||
name: Merged notification
|
||||
on:
|
||||
pull_request_target:
|
||||
types: ['closed']
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
if: github.event.repository.private == false && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
|
||||
if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
|
||||
4
.github/workflows/pa11y.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
2
.github/workflows/ping-staging-apps.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
env:
|
||||
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: npm run build
|
||||
|
||||
2
.github/workflows/remove-unused-assets.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: npm ci
|
||||
run: npm ci
|
||||
- name: Run scripts
|
||||
|
||||
25
.github/workflows/repo-freeze-reminders.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Repo Freeze Reminders
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "00 11 * * *" # once per day around 11:00am UTC
|
||||
|
||||
env:
|
||||
FREEZE: ${{ secrets.FREEZE }}
|
||||
|
||||
jobs:
|
||||
check-freezer:
|
||||
name: Remind about deployment freezes
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'github/docs-internal'
|
||||
steps:
|
||||
|
||||
- name: Send Slack notification if repo is frozen
|
||||
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!
|
||||
21
.github/workflows/repo-sync.yml
vendored
@@ -14,10 +14,9 @@ env:
|
||||
FREEZE: ${{ secrets.FREEZE }}
|
||||
|
||||
jobs:
|
||||
repo-sync:
|
||||
name: Repo Sync
|
||||
check-freezer:
|
||||
name: Check for deployment freezes
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
|
||||
- name: Exit if repo is frozen
|
||||
@@ -26,8 +25,14 @@ jobs:
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
|
||||
repo-sync:
|
||||
name: Repo Sync
|
||||
needs: check-freezer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Sync repo to branch
|
||||
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
|
||||
@@ -40,7 +45,7 @@ jobs:
|
||||
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
|
||||
- name: Create pull request
|
||||
uses: repo-sync/pull-request@ea6773388b83b337e4da9a223293309f2c3670e7
|
||||
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
||||
with:
|
||||
@@ -57,6 +62,7 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: repo-sync
|
||||
base: main
|
||||
|
||||
- name: Approve pull request
|
||||
if: ${{ steps.find-pull-request.outputs.number }}
|
||||
@@ -67,7 +73,10 @@ jobs:
|
||||
|
||||
- name: Send Slack notification if workflow fails
|
||||
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
|
||||
if: failure()
|
||||
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
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- name: Add issues with engineering label to project board
|
||||
if: contains(github.event.issue.labels.*.name, 'engineering') || contains(github.event.issue.labels.*.name, 'design') || contains(github.event.issue.labels.*.name, 'Design')
|
||||
uses: actions/github-script@44b873bc975058192f5279ebe7579496381f575d
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
script: |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Start new engineering PR workflow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
@@ -12,8 +12,7 @@ jobs:
|
||||
DRAFT_COLUMN_ID: 10095775
|
||||
REGULAR_COLUMN_ID: 10095779
|
||||
steps:
|
||||
- name:
|
||||
uses: actions/github-script@44b873bc975058192f5279ebe7579496381f575d
|
||||
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
continue-on-error: true
|
||||
with:
|
||||
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
name: Algolia
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -12,12 +13,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
- name: cache node modules
|
||||
uses: actions/cache@70655ec8323daeeaa7ef06d7c56e1b9191396cbe
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
10
.github/workflows/test-translations.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
with:
|
||||
ref: translations # check out the 'translations' branch
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -77,3 +77,5 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
run: npx jest tests/${{ matrix.test-group }}/
|
||||
env:
|
||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||
|
||||
39
.github/workflows/test-windows.yml
vendored
@@ -11,39 +11,6 @@ env:
|
||||
CI: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npx standard
|
||||
|
||||
- name: Check dependencies
|
||||
run: npm run check-deps
|
||||
|
||||
test:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
@@ -52,7 +19,7 @@ jobs:
|
||||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
@@ -65,7 +32,7 @@ jobs:
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -80,3 +47,5 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
run: npx jest tests/${{ matrix.test-group }}/
|
||||
env:
|
||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||
|
||||
72
.github/workflows/test.yml
vendored
@@ -28,94 +28,48 @@ jobs:
|
||||
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"]'
|
||||
lint:
|
||||
needs: see_if_should_skip
|
||||
runs-on: ubuntu-latest
|
||||
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@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Get npm cache directory
|
||||
id: npm-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Run linter
|
||||
run: npx standard
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Check dependencies
|
||||
run: npm run check-deps
|
||||
test:
|
||||
needs: see_if_should_skip
|
||||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test-group: [content, meta, rendering, routing, unit, links-and-images]
|
||||
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@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Setup node
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Get npm cache directory
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Cache node modules
|
||||
uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
|
||||
with:
|
||||
path: ${{ steps.npm-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Install dependencies
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Run build script
|
||||
- name: Run build script
|
||||
run: npm run build
|
||||
|
||||
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
|
||||
name: Run tests
|
||||
- name: Run tests
|
||||
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
|
||||
|
||||
4
.github/workflows/translations.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
branch: translations
|
||||
- if: ${{ steps.pr.outputs.number }}
|
||||
name: Check if already labeled
|
||||
uses: actions/github-script@5d03ada4b0a753e9460b312e61cc4f8fdeacf163
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
id: has-label
|
||||
with:
|
||||
script: |
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
number: ${{ steps.pr.outputs.number }}
|
||||
- if: ${{ !steps.has-label.outputs.result }}
|
||||
name: Add automerge label
|
||||
uses: actions/github-script@5d03ada4b0a753e9460b312e61cc4f8fdeacf163
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
|
||||
4
.github/workflows/triage-issue-comments.yml
vendored
@@ -5,12 +5,12 @@ on:
|
||||
|
||||
jobs:
|
||||
triage-issue-comments:
|
||||
if: github.repository == 'github/docs'
|
||||
if: github.repository == 'github/docs' && github.event.issue.pull_request == null
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check if the event originated from a team member
|
||||
uses: actions/github-script@6e5ee1dc1cb3740e5e5e76ad668e3f526edbfe45
|
||||
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||
id: is-internal-contributor
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
2
.github/workflows/triage-stale-check.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8
|
||||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
|
||||
|
||||
2
.github/workflows/update-graphql-files.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
echo 'The repo is currently frozen! Exiting this workflow.'
|
||||
exit 1 # prevents further steps from running
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: Set up Ruby
|
||||
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
|
||||
with:
|
||||
|
||||
@@ -50,7 +50,7 @@ When you're done making changes and you'd like to propose them for review, use t
|
||||
### Your PR is merged!
|
||||
Congratulations! The whole GitHub community thanks you. :sparkles:
|
||||
|
||||
Once your PR is merged, you can be added as a contributor in the [readme](README.md#contributors-).
|
||||
Once your PR is merged, you will be proudly listed as a contributor in the [contributor chart](https://github.com/github/docs/graphs/contributors).
|
||||
|
||||
### Keep contributing as you use GitHub Docs
|
||||
|
||||
@@ -94,7 +94,7 @@ A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and
|
||||
When we merge those changes, they should be deployed to the live site within 24 hours. :earth_africa: To learn more about opening a pull request in this repo, see [Opening a pull request](#opening-a-pull-request) below.
|
||||
|
||||
### :question: Support
|
||||
We are a small team working hard to keep up with the documentation demands of a continously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
|
||||
We are a small team working hard to keep up with the documentation demands of a continuously changing product. Unfortunately, we just can't help with support questions in this repository. If you are experiencing a problem with GitHub, unrelated to our documentation, please [contact GitHub Support directly](https://support.github.com/contact). Any issues, discussions, or pull requests opened here requesting support will be given information about how to contact GitHub Support, then closed and locked.
|
||||
|
||||
If you're having trouble with your GitHub account, contact [Support](https://support.github.com/contact).
|
||||
|
||||
@@ -134,7 +134,7 @@ Here's some information that might be helpful while working on a Docs PR:
|
||||
|
||||
- [Variables](/data/variables/README.md) - We use variables the same way we use reusables. Variables are for short strings of reusable text.
|
||||
|
||||
- [Liquid](/contribution/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
|
||||
- [Liquid](/contributing/liquid-helpers.md) - We use liquid helpers to create different versions of our content.
|
||||
|
||||
- [Scripts](/script/README.md) - The scripts directory is the home for all of the scripts you can run locally.
|
||||
|
||||
|
||||
BIN
assets/images/actions-log-group.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 18 KiB |
BIN
assets/images/enterprise/business-accounts/pages-tab.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/enterprise/configuration/ae-idp-configure.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
assets/images/enterprise/configuration/ae-idp-issuer-url.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 95 KiB |
BIN
assets/images/enterprise/configuration/ae-idp-sign-on-url.png
Normal file
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/images/enterprise/configuration/ae-policies-configure.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
assets/images/enterprise/configuration/ae-save.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/images/enterprise/configuration/ae-support-configure.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
assets/images/enterprise/configuration/ae-support-link-url.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 69 KiB |
BIN
assets/images/github-apps/github_apps_callback_url_multiple.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 28 KiB |
BIN
assets/images/help/dependabot/dependabot-alert-pr-link.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 64 KiB |
BIN
assets/images/help/dependabot/dependabot-tab-view-error-beta.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 61 KiB |
BIN
assets/images/help/enterprises/settings-scim-save.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/help/images/comparing-travis-with-actions.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 68 KiB |
BIN
assets/images/help/personal_token_ghae.png
Normal file
|
After Width: | Height: | Size: 543 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 29 KiB |
BIN
assets/images/help/repository/actions-failed-pester-test.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
assets/images/help/repository/audit-log-entries.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 67 KiB |
BIN
assets/images/help/saml/ae-edit-idp-details-save.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 57 KiB |
BIN
assets/images/help/saml/ae-edit-idp-details.png
Normal file
|
After Width: | Height: | Size: 317 KiB |
BIN
assets/images/help/saml/ae-saml-disabled-save.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
assets/images/help/saml/ae-saml-disabled.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 61 KiB |
@@ -2,9 +2,9 @@
|
||||
|
||||
The `/content` directory is where all the site's (English) Markdown content lives!
|
||||
|
||||
See the [markup reference guide](contributing/content-markup-reference.md) for more information about supported Markdown features.
|
||||
See the [markup reference guide](/contributing/content-markup-reference.md) for more information about supported Markdown features.
|
||||
|
||||
See the [contributing docs](contributing) for general information about working with the docs.
|
||||
See the [contributing docs](/CONTRIBUTING.md) for general information about working with the docs.
|
||||
|
||||
- [Frontmatter](#frontmatter)
|
||||
- [`versions`](#versions)
|
||||
@@ -16,7 +16,7 @@ See the [contributing docs](contributing) for general information about working
|
||||
- [`product`](#product)
|
||||
- [`layout`](#layout)
|
||||
- [`mapTopic`](#maptopic)
|
||||
- [`gettingStartedLinks` and `popularLinks`](#gettingstartedlinks-and-popularlinks)
|
||||
- [`featuredLinks`](#featuredlinks)
|
||||
- [`showMiniToc`](#showminitoc)
|
||||
- [`miniTocMaxHeadingLevel`](#minitocmaxheadinglevel)
|
||||
- [`allowTitleToDifferFromFilename`](#allowtitletodifferfromfilename)
|
||||
@@ -132,12 +132,22 @@ For a layout named `layouts/article.html`, the value would be `article`.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
- Optional.
|
||||
|
||||
### `gettingStartedLinks` and `popularLinks`
|
||||
### `featuredLinks`
|
||||
|
||||
- Purpose: Renders the linked articles' titles and intros under `Getting started` and `Popular articles` headings, respectively. See site homepage for an example.
|
||||
- Type: `Array`.
|
||||
- Purpose: Renders the linked articles' titles and intros on product landing pages and the homepage.
|
||||
- Type: `Object`.
|
||||
- Optional.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
featuredLinks:
|
||||
gettingStarted:
|
||||
- /path/to/page
|
||||
guides:
|
||||
- /guides/example
|
||||
```
|
||||
|
||||
### `showMiniToc`
|
||||
|
||||
- Purpose: Indicates whether an article should show a mini TOC above the rest of the content. See [Autogenerated mini TOCs](#autogenerated-mini-tocs) for more info.
|
||||
@@ -156,6 +166,12 @@ For a layout named `layouts/article.html`, the value would be `article`.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
- Optional.
|
||||
|
||||
### `changelog`
|
||||
|
||||
- Purpose: Render a list of changelog items with timestamps on product pages (ex: `layouts/product-landing.html`)
|
||||
- Type: `Array`, items are objects `{ href: string, title: string, date: 'YYYY-MM-DD' }`
|
||||
- Optional.
|
||||
|
||||
### Escaping single quotes
|
||||
|
||||
If you see two single quotes in a row (`''`) in YML frontmatter where you might expect to see one (`'`), this is the YML-preferred way to escape a single quote. From [the YAML spec](https://yaml.org/spec/history/2001-12-10.html):
|
||||
@@ -237,4 +253,4 @@ Sometimes you want to link to a Dotcom-only article in Enterprise content and yo
|
||||
<a href="/github/site-policy/github-terms-of-service" class="dotcom-only">GitHub's Terms of Service</a>
|
||||
```
|
||||
|
||||
Sometimes the canonical home of content moves outside the docs site. None of the links included in [`lib/redirects/external-redirects.json`](lib/redirects/external-redirects.json) get rewritten. See [`contributing/redirects.md`](contributing/redirects.md) for more info about this type of redirect.
|
||||
Sometimes the canonical home of content moves outside the docs site. None of the links included in [`lib/redirects/external-sites.json`](/lib/redirects/external-sites.json) get rewritten. See [`contributing/redirects.md`](/contributing/redirects.md) for more info about this type of redirect.
|
||||
|
||||
236
content/actions/guides/building-and-testing-powershell.md
Normal file
@@ -0,0 +1,236 @@
|
||||
---
|
||||
title: Building and testing PowerShell
|
||||
intro: You can create a continuous integration (CI) workflow to build and test your PowerShell project.
|
||||
product: '{% data reusables.gated-features.actions %}'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '>=2.22'
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
### Introduction
|
||||
|
||||
This guide shows you how to use PowerShell for CI. It describes how to use Pester, install dependencies, test your module, and publish to the PowerShell Gallery.
|
||||
|
||||
{% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with pre-installed software, which includes PowerShell and Pester. For a full list of up-to-date software and the pre-installed versions of PowerShell and Pester, see "[Specifications for {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/specifications-for-github-hosted-runners/#supported-software)".
|
||||
|
||||
### Prerequisites
|
||||
|
||||
You should be familiar with YAML and the syntax for {% data variables.product.prodname_actions %}. For more information, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)."
|
||||
|
||||
We recommend that you have a basic understanding of PowerShell and Pester. For more information, see:
|
||||
- [Getting started with PowerShell](https://docs.microsoft.com/powershell/scripting/learn/ps101/01-getting-started)
|
||||
- [Pester](https://pester.dev)
|
||||
|
||||
{% data reusables.actions.enterprise-setup-prereq %}
|
||||
|
||||
### Adding a workflow for Pester
|
||||
|
||||
To automate your testing with PowerShell and Pester, you can add a workflow that runs every time a change is pushed to your repository. In the following example, `Test-Path` is used to check that a file called `resultsfile.log` is present.
|
||||
|
||||
This example workflow file must be added to your repository's `.github/workflows/` directory:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Test PowerShell on Ubuntu
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
pester-test:
|
||||
name: Pester test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
- name: Perform a Pester test from the command-line
|
||||
shell: pwsh
|
||||
run: Test-Path resultsfile.log | Should -Be $true
|
||||
- name: Perform a Pester test from the Tests.ps1 file
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-Pester Unit.Tests.ps1 -Passthru
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
* `shell: pwsh` - Configures the job to use PowerShell when running the `run` commands.
|
||||
* `run: Test-Path resultsfile.log` - Check whether a file called `resultsfile.log` is present in the repository's root directory.
|
||||
* `Should -Be $true` - Uses Pester to define an expected result. If the result is unexpected, then {% data variables.product.prodname_actions %} flags this as a failed test. For example:
|
||||
|
||||

|
||||
|
||||
* `Invoke-Pester Unit.Tests.ps1 -Passthru` - Uses Pester to execute tests defined in a file called `Unit.Tests.ps1`. For example, to perform the same test described above, the `Unit.Tests.ps1` will contain the following:
|
||||
```
|
||||
Describe "Check results file is present" {
|
||||
It "Check results file is present" {
|
||||
Test-Path resultsfile.log | Should -Be $true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### PowerShell module locations
|
||||
|
||||
The table below describes the locations for various PowerShell modules in each {% data variables.product.prodname_dotcom %}-hosted runner.
|
||||
|
||||
|| Ubuntu | macOS | Windows |
|
||||
|------|-------|------|----------|
|
||||
|**PowerShell system modules** |`/opt/microsoft/powershell/7/Modules/*`|`/usr/local/microsoft/powershell/7/Modules/*`|`C:\program files\powershell\7\Modules\*`|
|
||||
|**PowerShell add-on modules**|`/usr/local/share/powershell/Modules/*`|`/usr/local/share/powershell/Modules/*`|`C:\Modules\*`|
|
||||
|**User-installed modules**|`/home/runner/.local/share/powershell/Modules/*`|`/Users/runner/.local/share/powershell/Modules/*`|`C:\Users\runneradmin\Documents\PowerShell\Modules\*`|
|
||||
|
||||
### Installing dependencies
|
||||
|
||||
{% data variables.product.prodname_dotcom %}-hosted runners have PowerShell 7 and Pester installed. You can use `Install-Module` to install additional dependencies from the PowerShell Gallery before building and testing your code.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce significant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
You can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
||||
|
||||
For example, the following job installs the `SqlServer` and `PSScriptAnalyzer` modules:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
install-dependencies:
|
||||
name: Install dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install from PSGallery
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module SqlServer, PSScriptAnalyzer
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** By default, no repositories are trusted by PowerShell. When installing modules from the PowerShell Gallery, you must explicitly set the installation policy for `PSGallery` to `Trusted`.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
#### Caching dependencies
|
||||
|
||||
You can cache PowerShell dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)."
|
||||
|
||||
PowerShell caches its dependencies in different locations, depending on the runner's operating system. For example, the `path` location used in the following Ubuntu example will be different for a Windows operating system.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup PowerShell module cache
|
||||
id: cacher
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "~/.local/share/powershell/Modules"
|
||||
key: ${{ runner.os }}-SqlServer-PSScriptAnalyzer
|
||||
- name: Install required PowerShell modules
|
||||
if: steps.cacher.outputs.cache-hit != 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module SqlServer, PSScriptAnalyzer -ErrorAction Stop
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Testing your code
|
||||
|
||||
You can use the same commands that you use locally to build and test your code.
|
||||
|
||||
#### Using PSScriptAnalyzer to lint code
|
||||
|
||||
The following example installs `PSScriptAnalyzer` and uses it to lint all `ps1` files in the repository. For more information, see [PSScriptAnalyzer on GitHub](https://github.com/PowerShell/PSScriptAnalyzer).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
lint-with-PSScriptAnalyzer:
|
||||
name: Install and run PSScriptAnalyzer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install PSScriptAnalyzer module
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module PSScriptAnalyzer -ErrorAction Stop
|
||||
- name: Lint with PSScriptAnalyzer
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues
|
||||
$errors = $issues.Where({$_.Severity -eq 'Error'})
|
||||
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
|
||||
if ($errors) {
|
||||
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
|
||||
} else {
|
||||
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
|
||||
}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Packaging workflow data as artifacts
|
||||
|
||||
You can upload artifacts to view after a workflow completes. For example, you may need to save log files, core dumps, test results, or screenshots. For more information, see "[Persisting workflow data using artifacts](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)."
|
||||
|
||||
The following example demonstrates how you can use the `upload-artifact` action to archive the test results received from `Invoke-Pester`. For more information, see the [`upload-artifact` action](https://github.com/actions/upload-artifact).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Upload artifact from Ubuntu
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
upload-pester-results:
|
||||
name: Run Pester and upload results
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test with Pester
|
||||
shell: pwsh
|
||||
run: Invoke-Pester Unit.Tests.ps1 -Passthru | Export-CliXml -Path Unit.Tests.xml
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ubuntu-Unit-Tests
|
||||
path: Unit.Tests.xml
|
||||
if: ${{ always() }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The `always()` function configures the job to continue processing even if there are test failures. For more information, see "[always](/actions/reference/context-and-expression-syntax-for-github-actions#always)."
|
||||
|
||||
### Publishing to PowerShell Gallery
|
||||
|
||||
You can configure your workflow to publish your PowerShell module to the PowerShell Gallery when your CI tests pass. You can use repository secrets to store any tokens or credentials needed to publish your package. For more information, see "[Creating and using encrypted secrets](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
|
||||
The following example creates a package and uses `Publish-Module` to publish it to the PowerShell Gallery:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Publish PowerShell Module
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
publish-to-gallery:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build and publish
|
||||
env:
|
||||
NUGET_KEY: ${{ secrets.NUGET_KEY }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
./build.ps1 -Path /tmp/samplemodule
|
||||
Publish-Module -Path /tmp/samplemodule -NuGetApiKey $env:NUGET_KEY -Verbose
|
||||
```
|
||||
{% endraw %}
|
||||
@@ -29,6 +29,7 @@ You can use {% data variables.product.prodname_actions %} to create custom conti
|
||||
{% link_in_list /about-continuous-integration %}
|
||||
{% link_in_list /setting-up-continuous-integration-using-workflow-templates %}
|
||||
{% link_in_list /building-and-testing-nodejs %}
|
||||
{% link_in_list /building-and-testing-powershell %}
|
||||
{% link_in_list /building-and-testing-python %}
|
||||
{% link_in_list /building-and-testing-java-with-maven %}
|
||||
{% link_in_list /building-and-testing-java-with-gradle %}
|
||||
|
||||
@@ -50,7 +50,7 @@ To push to Docker Hub, you will need to have a Docker Hub account, and have a Do
|
||||
|
||||
The `build-push-action` options required for Docker Hub are:
|
||||
|
||||
* `username` and `password`: This is your Docker Hub username and password. We recommend storing your Docker Hub username and password as encrypted secrets in the your {% data variables.product.prodname_dotcom %} repository so they aren't exposed in your workflow file. For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
* `username` and `password`: This is your Docker Hub username and password. We recommend storing your Docker Hub username and password as encrypted secrets in your {% data variables.product.prodname_dotcom %} repository so they aren't exposed in your workflow file. For more information, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
* `repository`: Your Docker Hub repository in the format `DOCKER-HUB-NAMESPACE/DOCKER-HUB-REPOSITORY`.
|
||||
|
||||
{% raw %}
|
||||
|
||||
@@ -74,7 +74,7 @@ For example, your repository or a web application might contain SASS and TypeScr
|
||||
|
|
||||
```
|
||||
|
||||
This example shows you how to create a workflow for a Node.js project that `builds` the code in the `src` directory and runs the tests in the `tests` directory. You can assume that running `npm test` produces a code coverage report named `code-coverage.html` stored in the `output/test/` directory.
|
||||
This example shows you how to create a workflow for a Node.js project that builds the code in the `src` directory and runs the tests in the `tests` directory. You can assume that running `npm test` produces a code coverage report named `code-coverage.html` stored in the `output/test/` directory.
|
||||
|
||||
The workflow uploads the production artifacts in the `dist` directory, but excludes any markdown files. It also and uploads the `code-coverage.html` report as another artifact.
|
||||
|
||||
@@ -171,12 +171,12 @@ Jobs that are dependent on a previous job's artifacts must wait for the dependen
|
||||
|
||||
Job 1 performs these steps:
|
||||
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
|
||||
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the name `homework`. The action places the file in a directory named `homework`.
|
||||
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework`.
|
||||
|
||||
Job 2 uses the result in the previous job:
|
||||
- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
|
||||
- Reads the value in the `homework/math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt`.
|
||||
- Uploads the `math-homework.txt` file. This upload overwrites the previous upload because both of the uploads share the same name.
|
||||
- Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents.
|
||||
- Uploads the `math-homework.txt` file. This upload overwrites the previously uploaded artifact because they share the same name.
|
||||
|
||||
Job 3 displays the result uploaded in the previous job:
|
||||
- Downloads the `homework` artifact.
|
||||
|
||||
@@ -91,7 +91,7 @@ The following operating systems are supported for the self-hosted runner applica
|
||||
|
||||
- macOS 10.13 (High Sierra) or later
|
||||
|
||||
{% if currentVersion != "free-pro-team@latest" %}
|
||||
{% if enterpriseServerVersions contains currentVersion %}
|
||||
|
||||
### Supported actions on self-hosted runners
|
||||
|
||||
@@ -111,9 +111,10 @@ You must ensure that the machine has the appropriate network access to communica
|
||||
github.com
|
||||
api.github.com
|
||||
*.actions.githubusercontent.com
|
||||
codeload.github.com
|
||||
```
|
||||
|
||||
If you use an IP address allow list for your {% data variables.product.prodname_dotcom %} organization or enterprise account, you must add your self-hosted runner's IP address to the allow list. For more information, see "[Managing allowed IP addresses for your organization](/github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list)" or "[Enforcing security settings in your enterprise account](/github/setting-up-and-managing-your-enterprise-account/enforcing-security-settings-in-your-enterprise-account#using-github-actions-with-an-ip-allow-list)".
|
||||
If you use an IP address allow list for your {% data variables.product.prodname_dotcom %} organization or enterprise account, you must add your self-hosted runner's IP address to the allow list. For more information, see "[Managing allowed IP addresses for your organization](/github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list)" or "[Enforcing security settings in your enterprise account](/github/setting-up-and-managing-your-enterprise/enforcing-security-settings-in-your-enterprise-account#using-github-actions-with-an-ip-allow-list)".
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
@@ -50,16 +50,11 @@ You can add self-hosted runners to an enterprise, where they can be assigned to
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" %}
|
||||
To add a self-hosted runner to an enterprise account, you must be an enterprise owner.
|
||||
{% else if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21"%}
|
||||
{% elsif enterpriseServerVersions contains currentVersion and currentVersion ver_gt "enterprise-server@2.21"%}
|
||||
To add a self-hosted runner at the enterprise level of {% data variables.product.product_location %}, you must be a site administrator.
|
||||
{% endif %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" %}
|
||||
{% data reusables.enterprise-accounts.access-enterprise %}
|
||||
{% else if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21"%}
|
||||
{% data reusables.enterprise_site_admin_settings.access-settings %}
|
||||
{% data reusables.enterprise_site_admin_settings.business %}
|
||||
{% endif %}
|
||||
{% data reusables.enterprise-accounts.policies-tab %}
|
||||
{% data reusables.enterprise-accounts.actions-tab %}
|
||||
1. Click the **Self-hosted runners** tab.
|
||||
|
||||