Generate Contributors List and Push to Collabora Github IO #143
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: Generate Contributors List and Push to Collabora Github IO | |
| on: | |
| schedule: | |
| - cron: '0 3 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| generate-contributors: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout IO repository | |
| - name: Checkout IO repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GENERATE_CONTRIBUTORS }} | |
| path: io | |
| # Install Node.js | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| # Debug paths (optional but very helpful) | |
| - name: Debug IO repo structure | |
| run: | | |
| echo "Listing IO repo:" | |
| ls -R io | |
| # Run the contributors script | |
| - name: Generate contributors.md | |
| run: | | |
| cd io | |
| npm install node-fetch@2 | |
| node scripts/contributors-credit.js | |
| echo "Contributors file generated inside content/post/" | |
| # Commit & Push using PAT | |
| - name: Commit and Push changes | |
| run: | | |
| cd io | |
| git config user.name "Darshan-upadhyay1110" | |
| git config user.email "darshan.upadhyay@collabora.com" | |
| git add content/post/contributors.md layouts/shortcodes/contributors-list.html | |
| git commit -m "Update contributors list" --signoff || echo "No changes to commit" | |
| git push https://x-access-token:${{ secrets.GENERATE_CONTRIBUTORS }}@github.com/CollaboraOnline/CollaboraOnline.github.io.git master |