Skip to content

Commit

Permalink
chore: Add Prettier for YML files (#19888)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored Aug 27, 2022
1 parent c7aeb96 commit fdce3d7
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/idle-issues.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Mark issues and pull requests as idle'
name: "Mark issues and pull requests as idle"
on:
schedule:
- cron: '49 11,23 * * *'
- cron: "49 11,23 * * *"

jobs:
idle:
Expand Down
63 changes: 31 additions & 32 deletions .github/workflows/interfacedata-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,41 @@ name: Update InterfaceData.json
on:
schedule:
# picking Fridays as webref IDL releases tend to be pushed on Thursdays
- cron: '0 0 * * 6'
- cron: "0 0 * * 6"
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest

steps:

- name: Setup node.js
uses: actions/setup-node@v3

- name: Checkout content
uses: actions/checkout@v3
with:
path: mdn-content
ref: main

- name: Checkout webref
uses: actions/checkout@v3
with:
repository: w3c/webref
path: webref
ref: "@webref/idl@latest"

- name: Extract data from webref
working-directory: mdn-content
run: node scripts/update-interface-data.mjs ../webref/

- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
path: mdn-content
token: ${{ secrets.GITHUB_TOKEN }}
title: Update InterfaceData based on WebRef
commit-message: Update InterfaceData based on WebRef
body: Automated changes generated by scripts/update-interface-data via interface-updater github workflow
delete-branch: true
branch: interfacedata-update
- name: Setup node.js
uses: actions/setup-node@v3

- name: Checkout content
uses: actions/checkout@v3
with:
path: mdn-content
ref: main

- name: Checkout webref
uses: actions/checkout@v3
with:
repository: w3c/webref
path: webref
ref: "@webref/idl@latest"

- name: Extract data from webref
working-directory: mdn-content
run: node scripts/update-interface-data.mjs ../webref/

- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
path: mdn-content
token: ${{ secrets.GITHUB_TOKEN }}
title: Update InterfaceData based on WebRef
commit-message: Update InterfaceData based on WebRef
body: Automated changes generated by scripts/update-interface-data via interface-updater github workflow
delete-branch: true
branch: interfacedata-update
10 changes: 5 additions & 5 deletions .github/workflows/issue-regex-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-regex-labeler.yml
enable-versioned-regex: 0
- uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-regex-labeler.yml
enable-versioned-regex: 0
4 changes: 2 additions & 2 deletions .github/workflows/lock-closed.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Lock old issues and pull requests'
name: "Lock old issues and pull requests"
on:
schedule:
- cron: '49 11,23 * * *'
- cron: "49 11,23 * * *"

jobs:
lock:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
paths:
- .markdownlint.json
- yarn.lock
- '**/*.md'
- "**/*.md"
- .github/workflows/markdown-lint.yml
- .github/workflows/markdownlint-problem-matcher.json


jobs:
docs:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-issues.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Mark new issues with needs-triage label'
name: "Mark new issues with needs-triage label"

on:
issues:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-demand-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
yarn build
echo "Disk usage size of build/"
du -sh $BUILD_OUT_ROOT
- name: Merge static assets with built documents
run: |
rsync -a node_modules/@mdn/yari/client/build/ build/
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
with:
path: yari/deployer/.venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/pr-review-companion.yml') }}

- name: Checkout Yari
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ping-other-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
branches: [main]
jobs:
ping:
if: github.repository == 'mdn/content' # Won’t be run from forks
if: github.repository == 'mdn/content' # Won’t be run from forks
runs-on: ubuntu-latest
steps:
- name: Ping w3c/mdn-spec-links
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pr-check_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- "**/*.json"
- .github/workflows/pr-check_json.yml


jobs:
docs:
runs-on: ubuntu-latest
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr-check_yml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint YAML

on:
pull_request:
branches:
- main
paths:
- yarn.lock
- "**/*.yml"
- .github/workflows/pr-check_yml.yml

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16"
cache: yarn

- name: Install all yarn packages
run: |
yarn --frozen-lockfile
- name: Lint markdown files
run: |
yarn lint:yml
8 changes: 4 additions & 4 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "Pull Request Labeler"
on:
- pull_request_target
- pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
8 changes: 4 additions & 4 deletions .github/workflows/system-file-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: System file changes
on:
pull_request_target:
paths:
- '.github/workflows/**'
- '.github/CODEOWNERS'
- '.github/dependabot.yml'
- 'scripts/**'
- ".github/workflows/**"
- ".github/CODEOWNERS"
- ".github/dependabot.yml"
- "scripts/**"
- package.json
- yarn.lock

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"build": "env-cmd --silent cross-env CONTENT_ROOT=files BUILD_OUT_ROOT=build yari-build",
"content": "env-cmd --silent cross-env CONTENT_ROOT=files yari-tool",
"filecheck": "env-cmd --silent cross-env CONTENT_ROOT=files yari-filecheck --cwd=.",
"fix:md": "npm run lint:md -- --fix",
"fix:json": "prettier -w \"**/*.json\"",
"lint:md": "markdownlint \"**/*.md\" -i node_modules",
"fix:md": "npm run lint:md -- --fix",
"fix:yml": "prettier -w \"**/*.yml\"",
"lint:json": "prettier -c \"**/*.json\"",
"lint:md": "markdownlint \"**/*.md\" -i node_modules",
"lint:yml": "prettier -c \"**/*.yml\"",
"start": "yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files REACT_APP_DISABLE_AUTH=true BUILD_OUT_ROOT=build yari-server",
"up-to-date-check": "node scripts/up-to-date-check.js"
},
Expand Down

0 comments on commit fdce3d7

Please sign in to comment.