name: Merge JSON files on: schedule: - cron: "0 0 * * *" workflow_dispatch: push: branches: # When someone push to `main` branch - main paths: - 'samples/**/assets/sample.json' jobs: merge: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: '20' - name: Download samples.json run: wget https://raw.githubusercontent.com/pnp/sp-dev-fx-extensions/main/.metadata/samples.json - name: Install dependencies run: npm install lodash - name: Merge JSON files run: node .github/workflows/merge.js - 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 }}