sp-dev-fx-webparts/.github/workflows/merge-json.yml

42 lines
1.0 KiB
YAML
Raw Normal View History

2024-03-24 14:31:20 -04:00
name: Merge JSON files
on:
2024-03-24 14:32:32 -04:00
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
push:
branches:
# When someone push to `main` branch
- main
paths:
- 'samples/**/assets/sample.json'
2024-03-24 14:31:20 -04:00
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
2024-03-24 14:48:51 -04:00
node-version: '20'
2024-03-24 14:31:20 -04:00
- name: Download samples.json
run: wget https://raw.githubusercontent.com/pnp/sp-dev-fx-extensions/main/.metadata/samples.json
- name: Install dependencies
2024-03-24 14:43:49 -04:00
run: npm install lodash
2024-03-24 14:31:20 -04:00
- name: Merge JSON files
run: node .github/workflows/merge.js
2024-03-24 15:19:12 -04:00
- name: Commit samples.json to gh-pages
uses: EndBug/add-and-commit@v9
with:
cwd: ./gh-pages
branch: gh-pages
add: 'samples.json --force'
push: true
token: ${{ secrets.GITHUB_TOKEN }}