-
Notifications
You must be signed in to change notification settings - Fork 70
60 lines (53 loc) · 1.86 KB
/
sync-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Sync content with MapLibre website
on:
push:
branches: [main]
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.TARGET_REPO_PAT }}
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."