Skip to content

add process docs changes workflow #13

add process docs changes workflow

add process docs changes workflow #13

name: Process Branches
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
checkout-docs-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout docs repository
uses: actions/checkout@v4
slurp-branches:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- master
- release-x.53.x
- release-x.52.x
- release-x.51.x
- release-x.50.x
- release-x.49.x
- release-x.48.x
- release-x.47.x
- release-x.48.x
- release-x.46.x
- release-x.45.x
- release-x.44.x
- release-x.43.x
# TODO: ^ add more release branches ^
steps:
# Clone only a subdirectory from branch {{matrix.branch}} on metabase/metabase using sparse checkout
# This will be much faster.
- name: Clone /docs/ from master with sparse checkout
with:
ref: ${{ matrix.branch }}
run: |

Check failure on line 41 in .github/workflows/slurp_branches.yml

View workflow run for this annotation

GitHub Actions / Process Branches

Invalid workflow file

The workflow is not valid. .github/workflows/slurp_branches.yml (Line: 41, Col: 9): Unexpected value 'run' .github/workflows/slurp_branches.yml (Line: 38, Col: 9): Required property is missing: uses
echo ${{ matrix.branch }}
git clone --depth 1 --branch ${{ matrix.branch }} --filter=blob:none --no-checkout https://github.com/metabase/metabase.git ../metabase-main
cd ../metabase-main
git sparse-checkout init --cone
git sparse-checkout set docs
git checkout master
# List all markdown files in the specific subdirectory
- name: Move markdown files
run: |
mkdir -p _docs/${{ matrix.branch }}/
cp -r ../metabase-main/docs/. _docs/${{ matrix.branch }}/
- name: List markdown files
run: |
ls -altr _docs
# # Optionally, commit and push if changes are expected:
# - name: Commit changes
# run: |
# git config user.name "GitHub Action"
# git config user.email "action@github.com"
# git add ${{ matrix.branch }}
# git commit -m "Processed file for ${{ matrix.branch }}"
# git push origin ${{ matrix.branch }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}