Create test.mdx #1
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: Process MDX Files | |
on: | |
pull_request: | |
paths: | |
- '**/*.mdx' | |
jobs: | |
process-mdx: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Run image processing script | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
run: python process_images.py | |
- name: Check for changes | |
id: git_status | |
run: | | |
if [[ -z $(git status --porcelain) ]]; then | |
echo "::set-output name=changes::false" | |
else | |
echo "::set-output name=changes::true" | |
fi | |
- name: Commit and push changes | |
if: steps.git_status.outputs.changes == 'true' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Processed images in MDX files" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |