Retrieve docs from contentful #27
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: Update MDX Images | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed_files | |
uses: tj-actions/[email protected] | |
with: | |
separator: "," | |
- name: Update MDX files | |
run: | | |
[ ! -d ./images/ ] && mkdir images | |
cd ./docs-utils/ | |
npm install front-matter image-downloader | |
cd .. | |
IFS=',' read -a filepaths <<< "${{ steps.changed_files.outputs.all_changed_files }}" | |
for filepath in "${filepaths[@]}"; do | |
if [[ $filepath == *.md ]] || [[ $filepath == *.mdx ]]; then | |
node ./docs-utils/update-images.js "./$filepath" | |
fi | |
done | |
- name: Commit and Push | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: update images in MDX files |