Skip to content

Sync content with MapLibre website #2

Sync content with MapLibre website

Sync content with MapLibre website #2

Workflow file for this run

name: Sync content with MapLibre website
on:
workflow_dispatch:
jobs:
create-pr-if-changed:
name: Create Pull Request if plugins list has changed
runs-on: ubuntu-latest
steps:
- name: checkout partial MapLibre repo
uses: actions/checkout@v4
with:
repository: maplibre/maplibre-gl-js
path: partial-repo
sparse-checkout: docs/plugins.md
sparse-checkout-cone-mode: false
- name: checkout awesome MapLibre repo
uses: actions/checkout@v4
with:
path: awesome
- name: generate plugins.md
run: node awesome/scripts/extract.mjs awesome/README.md awesome/scripts/plugins.template.md > plugins.new.md
- name: Check if plugins.md content has changed
id: check_file
run: |
if diff partial-repo/docs/plugins.md plugins.new.md > /dev/null; then
echo "FILE_UPDATED=0" >> $GITHUB_ENV
else
echo "FILE_UPDATED=1" >> $GITHUB_ENV
fi
- name: checkout complete MapLibre repo
if: ${{ env.FILE_UPDATED == '1' }}
uses: actions/checkout@v4
with:
repository: maplibre/maplibre-gl-js
path: complete-repo
- name: copy updated plugins.md
if: ${{ env.FILE_UPDATED == '1' }}
run: |
cp plugins.new.md complete-repo/docs/plugins.md
- name: Create PR
if: ${{ env.FILE_UPDATED == '1' }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: complete-repo
branch: doc/sync
branch-suffix: timestamp
base: main
commit-message: "[doc] update plugins page"
title: "[doc] auto-sync plugins page from maplibre-gl"
body: "This pull request was automatically created by GitHub Actions."