Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell authored Nov 4, 2024
2 parents 469ee61 + 53428da commit 909b8ee
Show file tree
Hide file tree
Showing 305 changed files with 7,403 additions and 4,176 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
groups:
docusaurus:
patterns:
- "@docusaurus*"
deps:
dependency-type: "production"
exclude-patterns:
- "@docusaurus*"
dev-deps:
dependency-type: "development"
exclude-patterns:
- "@docusaurus*"


- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
Expand Down
65 changes: 44 additions & 21 deletions .github/workflows/check-all-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,61 @@ name: Check all content (MDX) links
on:
pull_request:

permissions:
actions: read
checks: read
contents: read
issues: write
pull-requests: write

jobs:
check-for-absolute-urls:
name: "Check for absolute prisma.io urls"
name: "Check for dangerous urls"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: check for docs urls
- name: check docs urls
id: absolute-urls
run: |
FILES_WITH_ABS_URLS=$(grep -Erl "https://prisma\.io/docs|https://www\.prisma\.io/docs" content) || echo "no absolute URLs found."
OUTPUT="## Absolute URL check"$'\n'
FILES_WITH_LOCAL_URLS=$(grep -Prl "(?<!!)\[.+\]\(\..+\)" content) || echo "no local URLs found."
OUTPUT="## Dangerous URL check"$'\n'
SUCCESS=false
if [ -n "${FILES_WITH_ABS_URLS}" ]; then # if there were matching files
OUTPUT+="### Absolute URLs"$'\n'
OUTPUT+="The following files have absolute URLs to prisma.io/docs. Please replace them with relative URLs."$'\n'
OUTPUT+="Example: https://www.prisma.io/docs/getting-started/quickstart -> /getting-started/quickstart"$'\n'
for line in ${FILES_WITH_ABS_URLS}
do
OUTPUT+="${line}"$'\n'
done
OUTPUT+=""$'\n'
else
# no matching files
OUTPUT+="No absolute URLs to prisma.io/docs found."
OUTPUT+="No absolute URLs to prisma.io/docs found."$'\n'
SUCCESS=true
fi
if [ -n "${FILES_WITH_LOCAL_URLS}" ]; then
OUTPUT+="### Local URLs"$'\n'
OUTPUT+="The following files have local URLs. Please remove any leading dots."$'\n'
OUTPUT+="Example: ./getting-started/quickstart -> /getting-started/quickstart"$'\n'
for line in ${FILES_WITH_LOCAL_URLS}
do
OUTPUT+="${line}"$'\n'
done
else
OUTPUT+="No local URLs found."$'\n'
SUCCESS=true
fi
# check success
if [ -n "${FILES_WITH_ABS_URLS}" ] || [ -n "${FILES_WITH_LOCAL_URLS}" ]; then
SUCCESS=false
else
SUCCESS=true
fi
# https://github.com/orgs/community/discussions/26288#discussioncomment-3876281
{
echo 'body<<EOF'
Expand All @@ -41,6 +71,8 @@ jobs:
pull-request: ${{ github.event.pull_request.number }}
body: ${{ steps.absolute-urls.outputs.body }}
body-includes: absolute URLs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: report success
run: |
Expand All @@ -50,8 +82,8 @@ jobs:
exit 1;
fi
check-for-dead-external-links:
name: Check external links
check-for-dead-links:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -65,27 +97,16 @@ jobs:
- name: Install remark presets
run: npm install remark-lint-no-dead-urls remark-custom-header-id

- name: run remark-cli
- name: Check external links (remark-cli)
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
npx remark-cli . -qf -e=md,mdx --use remark-mdx --use remark-custom-header-id --use remark-frontmatter --use remark-gfm \
--use "remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:['https://www.notion.so/prismaio','https://www.prisma.io/docs','https://dash.cloudflare.com','https://www.cloudflare.com']"
check-for-dead-internal-links:
name: Check internal links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install deps
run: npm install

- name: test build
- name: Check internal links (docusaurus build)
env:
DOCUSAURUS_POST_HOG_KEY: ${{ secrets.DOCUSAURUS_POST_HOG_KEY }}
run: npm run clean && npm run build

check-for-redirects:
Expand All @@ -105,3 +126,5 @@ jobs:
pull-request: ${{ github.event.pull_request.number }}
body: ${{ steps.redirects.outputs.body }}
body-includes: following redirects
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/image-optimise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: |
github.event_name != 'pull_request' &&
steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v6.0.5
uses: peter-evans/create-pull-request@v7.0.5
with:
title: Auto Compress Images
branch-suffix: timestamp
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/list-changed-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
paths:
- "content/**/*"

permissions:
actions: read
checks: read
contents: read
issues: write
pull-requests: write

jobs:
post-files-changed-comment:
name: "Post files changed comment"
Expand All @@ -15,7 +22,7 @@ jobs:

- name: Get all changed markdown files
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
files: content/**/*.{md,mdx}

Expand Down Expand Up @@ -51,3 +58,5 @@ jobs:
pull-request: ${{ github.event.pull_request.number }}
body: ${{ steps.build-comment-body.outputs.body }}
body-includes: "original | preview"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/lost-pixel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- name: Get all changed markdown files
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
files: content/**/*.{md,mdx}

Expand All @@ -38,6 +38,8 @@ jobs:
run: npm install

- name: Build docs
env:
DOCUSAURUS_POST_HOG_KEY: ${{ secrets.DOCUSAURUS_POST_HOG_KEY }}
run: npm run clean && npm run build

- name: Start docs
Expand All @@ -50,6 +52,6 @@ jobs:
run: sed -i -e 's/_/\//g' -e 's|prisma\.io||g' -re 's/(name.+)(\/)(\")/\1-\3/g' lost-pixel-pages.json

- name: Lost Pixel
uses: lost-pixel/lost-pixel@v3.17.0
uses: lost-pixel/lost-pixel@v3.18.2
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}
13 changes: 11 additions & 2 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@
"Zenstack",
"Streamdal",
"leaderboard",
"typesense"
"typesense",
"Solidstart",
"Astro",
"unikernels",
"Postico"
],
"ignoreWords": [
"Ania",
Expand All @@ -98,7 +102,12 @@
"Nikolas",
"Supavisor",
"inshellisense",
"janedoe"
"janedoe",
"unindexed",
"Hyperdrive",
"pgcat",
"JAFNSZHQRDTW",
"BCAA"
],
"patterns": [
{
Expand Down
Loading

0 comments on commit 909b8ee

Please sign in to comment.