Merge pull request #50 from ipsitdebnath/Ipsit #63
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 Contributors Data | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'contributors/**' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'contributors/**' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build data.json | |
| run: npm run build | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git diff --exit-code data.json || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Commit and push if changed | |
| if: steps.git-check.outputs.changed == 'true' && github.event_name == 'push' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add data.json | |
| git commit -m "🤖 Auto-update data.json from contributors" | |
| git push |