-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
970 changed files
with
44,968 additions
and
73,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Editor config | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
max_line_length = 100 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{md,mdx}] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
content/* @prisma/dev-advocates-write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
|
||
- 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: "/"`.) | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,62 @@ | ||
name: Comment based on changed pages (Vercel Deploy URLs + Redirect Suggestions) | ||
|
||
name: List Changed Pages | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- docusaurus | ||
paths: | ||
- 'content/**/*' | ||
|
||
jobs: | ||
post-comment-with-links-to-changed-pages: | ||
name: Create or Update | ||
post-files-changed-comment: | ||
name: 'Post files changed comment' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get list of changed files | ||
id: files | ||
uses: Ana06/[email protected] # it's a fork of jitterbit/get-changed-files@v1 which works better with pull requests | ||
- name: List Vercel Deploy URLs | ||
id: links | ||
# Note that this uses `%0A` instead of `\n` because of https://github.com/peter-evans/create-or-update-comment#setting-the-comment-body-from-a-file which I could not get to work here - but this brute force method does. | ||
run: | | ||
body="This PR changes the following pages (Vercel Preview Deploy links):%0A%0A" | ||
no_changed_pages="%0A- This PR does not change any pages the [GH Actions workflow](https://github.com/prisma/docs/blob/main/.github/workflows/list-changed-pages.yml) could detect." | ||
vercelLinks="Changed Vercel links" | ||
body="$body%0A%0A$vercelLinks" | ||
for changed_file in ${{ steps.files.outputs.all }}; do | ||
if [[ $changed_file == content/* ]] | ||
then | ||
no_changed_pages="" | ||
cleaned_file=$(echo "$changed_file" | sed -E 's:content/:/:g' | sed -E 's:/index.mdx::g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' ) | ||
branch_name=$(echo "${{github.event.pull_request.head.ref}}" | sed -e 's/\//-/g') | ||
# TODO special case for images and similar non .mdx files | ||
# Output inside the action | ||
echo "- https://docs-git-${branch_name}-prisma.vercel.app$cleaned_file" | ||
# Also collect into string | ||
linksVercel="%0A- [/docs$cleaned_file](https://docs-git-${branch_name}-prisma.vercel.app$cleaned_file) ([currently](https://prisma.io/docs$cleaned_file))" | ||
body="$body$linksVercel" | ||
fi | ||
done | ||
body="$body$no_changed_pages" | ||
body="$body%0A%0A(Note that links will only be valid after Vercel preview deploy succeeded)" | ||
echo "::set-output name=body::$body" | ||
- name: Find existing comment (links) | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: following pages | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create comment (links) | ||
if: steps.fc.outputs.comment-id == '' | ||
uses: peter-evans/create-or-update-comment@v1 | ||
- name: Get all changed markdown files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: ${{ steps.links.outputs.body }} | ||
files: content/**/*.{md,mdx} | ||
|
||
- name: Update comment (links) | ||
if: steps.fc.outputs.comment-id != '' | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
body: ${{ steps.links.outputs.body }} | ||
edit-mode: replace | ||
|
||
### REDIRECTS ### | ||
|
||
- name: Create suggested redirects | ||
id: redirects | ||
- name: Build comment body | ||
id: build-comment-body | ||
env: | ||
CHANGED_FILES: ${{ steps.changed-files.outputs.any_changed }} | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
bash .github/workflows/scripts/generate-redirects.sh | ||
- name: Find existing comment (redirects) | ||
uses: peter-evans/find-comment@v1 | ||
id: fc2 | ||
OUTPUT="" | ||
if [ ${CHANGED_FILES} == 'true' ]; then | ||
OUTPUT="| original | preview |%0A| ------ | ------ |%0A" | ||
for file in ${ALL_CHANGED_FILES} | ||
do | ||
OUTPUT+="| ${file} | |%0A" | ||
done | ||
else | ||
OUTPUT="No files changed." | ||
fi | ||
echo "::set-output name=body::$OUTPUT" | ||
- name: Find existing comment | ||
uses: peter-evans/find-comment@v3 | ||
id: find-existing | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: following redirects | ||
body-includes: 'original | preview' | ||
|
||
- name: Create comment (redirects) | ||
if: steps.fc2.outputs.comment-id == '' | ||
uses: peter-evans/create-or-update-comment@v1 | ||
- name: Create comment | ||
if: steps.find-existing.outputs.comment-id == '' | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: ${{ steps.redirects.outputs.body }} | ||
body: ${{ steps.build-comment-body.outputs.body }} | ||
|
||
- name: Update comment (redirects) | ||
if: steps.fc2.outputs.comment-id != '' | ||
uses: peter-evans/create-or-update-comment@v1 | ||
- name: Update comment | ||
if: steps.find-existing.outputs.comment-id != '' | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ steps.fc2.outputs.comment-id }} | ||
body: ${{ steps.redirects.outputs.body }} | ||
comment-id: ${{ steps.find-existing.outputs.comment-id }} | ||
body: ${{ steps.build-comment-body.outputs.body }} | ||
edit-mode: replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
name: LostPixel | ||
|
||
name: 'Lost Pixel' | ||
on: [push] | ||
|
||
jobs: | ||
gatsby-for-percy: | ||
name: Lost Pixel screenshots via Gatsby build | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Lost Pixel | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
node-version: '14' | ||
- run: npm ci | ||
- name: Caching Gatsby | ||
id: gatsby-cache-build | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
public | ||
.cache | ||
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }} | ||
restore-keys: | | ||
${{ runner.os }}-gatsby-build- | ||
- name: Build Gatsby app | ||
run: npx gatsby build --prefix-paths | ||
env: | ||
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true | ||
CI: true | ||
node-version: 18 | ||
|
||
- name: Install deps | ||
run: npm install | ||
|
||
- name: Build docs | ||
run: npm run clean && npm run build | ||
|
||
- name: Start docs | ||
run: npm run serve & | ||
|
||
- name: Generate sitemap | ||
run: npx lost-pixel page-sitemap-gen http://172.17.0.1:3000/sitemap.xml "./lost-pixel-pages.json" | ||
|
||
- name: Run Gatsby app | ||
run: npx gatsby serve --host 172.17.0.1 & | ||
- name: Edit page names | ||
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.4.4 | ||
uses: lost-pixel/lost-pixel@v3.16.0 | ||
env: | ||
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.