Skip to content

repo sync #23090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/node-npm-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node set up composite

description: Will set up Node and install all packages by caching node_modules

runs:
using: 'composite'
steps:
- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
shell: bash
run: npm install --prefer-offline --no-audit --ignore-scripts
9 changes: 1 addition & 8 deletions .github/workflows/check-broken-links-github-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,10 @@ jobs:
path: docs-early-access
ref: main

- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Merge docs-early-access repo's folders
run: .github/actions-scripts/merge-early-access.sh

- name: Install Node.js dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Build server
run: npm run build
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,12 @@ concurrency:
jobs:
lint:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- uses: ./.github/actions/node-npm-setup

- name: Run linter
run: npm run lint
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ jobs:
- name: Checkout repository code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install Node.js dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Run script/update-enterprise-dates.js
run: |
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/keep-caches-warm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- uses: ./.github/actions/node-npm-setup

- name: Cache nextjs build
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/link-check-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ jobs:

- name: Check out repo's default branch
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Figure out which docs-early-access branch to checkout, if internal repo
if: ${{ github.repository == 'github/docs-internal' }}
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/link-check-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,7 @@ jobs:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- uses: ./.github/actions/node-npm-setup

- name: Figure out which docs-early-access branch to checkout, if internal repo
if: ${{ github.repository == 'github/docs-internal' }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/manually-purge-fastly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Soft-purge Fastly cache
env:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/open-enterprise-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ jobs:
- name: Checkout repository code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Check for existing release or deprecation issues
id: existingIssue
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/openapi-decorate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ jobs:
# CI in the PR. (Events from GITHUB_TOKEN don't trigger new workflows.)
token: ${{ secrets.DOCUBOT_REPO_PAT }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Decorate the dereferenced OpenAPI schemas
run: script/rest/update-files.js --decorate-only
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/orphaned-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,7 @@ jobs:
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/ko-KR

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Check for orphaned assets
env:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/purge-fastly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Purge Fastly edge cache independent of language
if: ${{ github.event.inputs.nuke_all }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/sync-search-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,7 @@ jobs:
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translation

- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Cache nextjs build
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/sync-search-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- uses: ./.github/actions/node-npm-setup

- name: Cache nextjs build
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm

- name: Install dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Figure out which docs-early-access branch to checkout, if internal repo
if: ${{ github.repository == 'github/docs-internal' }}
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/translation-health-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ jobs:
gitref=$(cd ${{ matrix.language_dir }} && git rev-parse --short HEAD)
echo "gitref=$gitref" >> $GITHUB_ENV

- name: 'Setup node'
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'

- name: npm ci
run: npm ci
- uses: ./.github/actions/node-npm-setup

- name: Create translation health report
run: |
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/update-graphql-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ jobs:
exit 1 # prevents further steps from running
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm
- name: Install Node.js dependencies
run: npm ci
- uses: ./.github/actions/node-npm-setup
- name: Run updater scripts
env:
# need to use a token from a user with access to github/github for this step
Expand Down
30 changes: 14 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"@github/failbot": "0.8.0",
"@primer/behaviors": "^1.3.1",
"@primer/css": "^20.2.4",
"@primer/octicons": "17.7.0",
"@primer/octicons-react": "17.7.0",
"@primer/octicons": "17.10.1",
"@primer/octicons-react": "17.10.1",
"@primer/react": "^35.2.2",
"accept-language-parser": "^1.5.0",
"ajv": "^8.11.0",
Expand Down
8 changes: 7 additions & 1 deletion tests/unit/actions-workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const scheduledWorkflows = workflows
.flat()
.map((schedule) => schedule.cron)

const allUsedActions = chain(workflows).map(actionsUsedInWorkflow).flatten().uniq().sort().value()
const allUsedActions = chain(workflows)
.map(actionsUsedInWorkflow)
.flatten()
.uniq()
.filter((use) => !use.startsWith('.'))
.sort()
.value()

describe('GitHub Actions workflows', () => {
test('all used actions are listed', () => {
Expand Down