Docusaurus: fix broken links and throw on broken links #8074
Workflow file for this run
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
name: List Changed Pages | |
on: | |
pull_request: | |
branches: | |
- main | |
- docusaurus | |
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 }} | |
run: | | |
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@v1 | |
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@v1 | |
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@v1 | |
with: | |
comment-id: ${{ steps.find-existing.outputs.comment-id }} | |
body: ${{ steps.build-comment-body.outputs.body }} | |
edit-mode: replace |