Merge pull request #40 from drupaltools/39_mcp #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build API Data | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - '_data/projects/**' | |
| - '_scripts/build-api-data.js' | |
| pull_request: | |
| branches: [ main, master ] | |
| paths: | |
| - '_data/projects/**' | |
| workflow_dispatch: | |
| jobs: | |
| build-api: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build API data | |
| run: node _scripts/build-api-data.js | |
| - name: Commit API data | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add api/data/ | |
| if git diff --staged --quiet; then | |
| git commit -m "Auto-update API data [skip ci]" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |