Skip to content
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
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/scripts @mdn/engineering
/tests @mdn/engineering

# These are @mdn-bot because the auto-merge GHA workflow uses the PAT of this account.
# If another reviewer is specified, update the PAT token or auto-merge will cease to be automatic.
/package.json @mdn/engineering @mdn-bot
/yarn.lock @mdn/engineering @mdn-bot
# Dependencies
/package.json @mdn/engineering @mdn-bot
/package-lock.json @mdn/engineering @mdn-bot
/yarn.lock @mdn/engineering @mdn-bot
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ system:
- changed-files:
- any-glob-to-any-file:
- package.json
- yarn.lock
- package-lock.json
- .github/**
- .vscode/**
- .*
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/auto-cleanup-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:
node-version-file: ".nvmrc"
package-manager-cache: false

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LEFTHOOK: 0

- name: Lint markdown files
run: |
yarn content fix-flaws
yarn fix:md
yarn fix:fm
npm run content fix-flaws
npm run fix:md
npm run fix:fm
node scripts/sort_and_unique_file_lines.js .vscode/dictionaries
env:
# Used by the `rari` cli to avoid rate limiting issues
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- .nvmrc
- .prettier*
- package.json
- yarn.lock
- package-lock.json
- .github/workflows/markdown-lint.yml
- .github/workflows/markdownlint-problem-matcher.json

Expand All @@ -27,16 +27,16 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint markdown files
run: |
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
yarn lint:md
yarn lint:fm
npm run lint:md
npm run lint:fm
12 changes: 6 additions & 6 deletions .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
- name: Install
if: steps.check.outputs.HAS_FILES == 'true'
run: yarn --frozen-lockfile
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:

echo "Running markdownlint --fix"
MD_LINT_FAILED=false
MD_LINT_LOG=$(yarn markdownlint-cli2 --fix "${files_to_lint[@]}" 2>&1) || MD_LINT_FAILED=true
MD_LINT_LOG=$(npx markdownlint-cli2 --fix "${files_to_lint[@]}" 2>&1) || MD_LINT_FAILED=true
echo "MD_LINT_LOG<<${EOF}" >> "$GITHUB_OUTPUT"
echo "${MD_LINT_LOG}" >> "$GITHUB_OUTPUT"
echo "${EOF}" >> "$GITHUB_OUTPUT"
Expand All @@ -135,12 +135,12 @@ jobs:

echo "Running Prettier"
PRETTIER_FAILED=false
PRETTIER_LOG=$(yarn prettier --check "${files_to_lint[@]}" 2>&1) || PRETTIER_FAILED=true
PRETTIER_LOG=$(npx prettier --check "${files_to_lint[@]}" 2>&1) || PRETTIER_FAILED=true
echo "PRETTIER_LOG<<${EOF}" >> "$GITHUB_OUTPUT"
echo "${PRETTIER_LOG}" >> "$GITHUB_OUTPUT"
echo "${EOF}" >> "$GITHUB_OUTPUT"
echo "PRETTIER_FAILED=${PRETTIER_FAILED}" >> "$GITHUB_OUTPUT"
yarn prettier -w "${files_to_lint[@]}"
npx prettier -w "${files_to_lint[@]}"

if [[ -n $(git diff) ]]; then
echo "FILES_MODIFIED=true" >> "$GITHUB_OUTPUT"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-check_javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint JavaScript files
run: yarn lint:js
run: npm run lint:js
8 changes: 4 additions & 4 deletions .github/workflows/pr-check_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint JSON files
run: yarn lint:json
run: npm run lint:json
8 changes: 4 additions & 4 deletions .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

# This is a "required" workflow so path filtering can not be used:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
Expand All @@ -34,16 +34,16 @@ jobs:
- "files/**"
- ".github/workflows/pr-check_redirects.yml"

- name: Install all yarn packages
- name: Install
if: steps.filter.outputs.required_files == 'true'
run: yarn --frozen-lockfile
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check redirects file(s)
if: steps.filter.outputs.required_files == 'true'
run: yarn content validate-redirects en-US
run: npm run content validate-redirects en-US
env:
# Used by the `rari` cli to avoid rate limiting issues
# when fetching the latest releases info from the GitHub API.
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/pr-check_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- .nvmrc
- package.json
- yarn.lock
- package-lock.json
- .github/workflows/pr-check_scripts.yml

# No GITHUB_TOKEN permissions, as we only use it to increase API limit.
Expand All @@ -24,15 +24,15 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: yarn install
run: yarn --frozen-lockfile
- name: npm ci
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: yarn up-to-date-check
- run: npm run up-to-date-check

start:
runs-on: ubuntu-latest
Expand All @@ -46,16 +46,16 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: yarn install
run: yarn --frozen-lockfile
- name: npm ci
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: yarn start
run: yarn start > /tmp/stdout.log 2> /tmp/stderr.log &
- name: npm start
run: npm start > /tmp/stdout.log 2> /tmp/stderr.log &

- name: Wait for Rari (localhost:8083)
run: curl --retry-connrefused --retry 5 -I http://localhost:8083/en-US/
Expand Down Expand Up @@ -88,15 +88,15 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: yarn install
run: yarn --frozen-lockfile
- name: npm ci
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: yarn filecheck --help
- run: npm run filecheck -- --help

content:
runs-on: ubuntu-latest
Expand All @@ -110,19 +110,19 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: yarn content --help
- run: npm run content -- --help

- run: yarn content fix-redirects en-US
- run: npm run content fix-redirects en-US

- run: yarn content validate-redirects en-US
- run: npm run content validate-redirects en-US

build:
runs-on: ubuntu-latest
Expand All @@ -136,12 +136,12 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: yarn install
run: yarn --frozen-lockfile
- name: npm ci
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: yarn build --help
- run: npm run build -- --help
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_url-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Check URL deletions and broken fragments
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check_yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
paths:
- .nvmrc
- yarn.lock
- package-lock.json
- "**/*.yml"
- .github/workflows/pr-check_yml.yml

Expand All @@ -24,13 +24,13 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Install
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint markdown files
run: yarn lint:yml
run: npm run lint:yml
2 changes: 1 addition & 1 deletion .github/workflows/pr-review-companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: content
run: yarn --frozen-lockfile
run: npm ci

- name: Analyze PR build
if: steps.check.outputs.HAS_ARTIFACT
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
# This is the directory where the built files will be placed.
# It's also hardcoded in the `yarn build` command in package.json.
# It's also hardcoded in the `npm run build` command in package.json.
# If you change it here, you must also make the same change in
# package.json.
BUILD_OUT_ROOT: build
Expand Down Expand Up @@ -81,11 +81,11 @@ jobs:
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".nvmrc"
cache: yarn
cache: npm

- name: Install all yarn packages
- name: Install
if: steps.check.outputs.HAS_FILES == 'true'
run: yarn --frozen-lockfile
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -135,12 +135,12 @@ jobs:
ARGS+=("-f" "$PWD/$file")
done

yarn rari build --no-basic --json-issues --data-issues "${ARGS[@]}"
npx rari build --no-basic --json-issues --data-issues "${ARGS[@]}"

# Workaround, as fred-ssr doesn't copy assets.
cp -vR node_modules/@mdn/fred/out/. "$BUILD_OUT_ROOT"

yarn fred-ssr
npx fred-ssr

echo "Disk usage size of the build"
du -sh $BUILD_OUT_ROOT
Expand Down Expand Up @@ -172,4 +172,4 @@ jobs:
readarray -t files_to_check <<< "$GIT_DIFF_FILES"

export CONTENT_ROOT=$(pwd)/files
yarn filecheck "${files_to_check[@]}"
npm run filecheck "${files_to_check[@]}"
Loading
Loading