Skip to content

Commit

Permalink
Create process_mdx_file.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmIriarte authored Jul 16, 2024
1 parent 7cae0c4 commit 16ebe46
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/process_mdx_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 }}

0 comments on commit 16ebe46

Please sign in to comment.