.github/workflows/get-followers.yml #14
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: Get Followers | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 0 * * *" # This will run the workflow every day at 12:30 AM UTC or 6:00 AM IST | |
| jobs: | |
| update-followers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update followers list | |
| run: | | |
| cd scripts && npm install && ACCESS_TOKEN=${{ secrets.ACCESS_TOKEN }} npm run get:followers | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add -A | |
| git diff-index --quiet HEAD || git commit -m "Update followers list" | |
| - name: Pull changes | |
| run: git pull -r | |
| - name: Push changes | |
| uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df | |
| with: | |
| ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} |