Skip to content

add --with-model cli option to init command #8313

add --with-model cli option to init command

add --with-model cli option to init command #8313

name: List Changed Pages
on:
pull_request:
branches:
- main
paths:
- 'content/**/*'
jobs:
post-files-changed-comment:
name: 'Post files changed comment'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get all changed markdown files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: content/**/*.{md,mdx}
- 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 }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
shopt -s extglob # enable extended globbing
OUTPUT=""
if [ ${CHANGED_FILES} == 'true' ]; then
OUTPUT="| original | preview |%0A| ------ | ------ |%0A"
for file in ${ALL_CHANGED_FILES}
do
FILE_PATH=${file//+([0-9])-/} # remove numeric prefixes
FILE_PATH=${FILE_PATH#content\/} # remove "content/"
FILE_PATH=${FILE_PATH%.mdx} # remove ".mdx"
FILE_PATH=${FILE_PATH%index} # remove "index"
OUTPUT+="| [${file}](https://www.prisma.io/docs/${FILE_PATH}) | [${file}](https://${BRANCH_NAME}.docs-51g.pages.dev/${FILE_PATH}) |%0A"
done
else
OUTPUT="No files changed."
fi
echo "::set-output name=body::$OUTPUT"
shopt -u extglob # disable extended globbing
- 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: 'original | preview'
- 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.build-comment-body.outputs.body }}
- name: Update comment
if: steps.find-existing.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-existing.outputs.comment-id }}
body: ${{ steps.build-comment-body.outputs.body }}
edit-mode: replace