|
| 1 | +name: prefetch-sponsors |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: '*/15 * * * *' # Run every 15 minutes |
| 5 | + workflow_dispatch: # Allow manual triggering |
| 6 | + |
| 7 | +jobs: |
| 8 | + prefetch-sponsors: |
| 9 | + name: prefetch-sponsors |
| 10 | + runs-on: ubuntu-latest |
| 11 | + timeout-minutes: 10 |
| 12 | + steps: |
| 13 | + - name: 'Setup: checkout project' |
| 14 | + uses: actions/checkout@v5 |
| 15 | + with: |
| 16 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 17 | + |
| 18 | + - name: 'Setup: environment' |
| 19 | + uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: 'lts/*' |
| 22 | + cache: 'npm' |
| 23 | + |
| 24 | + - name: 'Init: install Node.js packages' |
| 25 | + run: npm ci |
| 26 | + |
| 27 | + - name: 'Run: prefetch sponsors' |
| 28 | + run: npm run prefetch-sponsors |
| 29 | + |
| 30 | + - name: 'Check: for changes' |
| 31 | + id: check-changes |
| 32 | + run: | |
| 33 | + if git diff --quiet; then |
| 34 | + echo "No changes detected" |
| 35 | + echo "has_changes=false" >> $GITHUB_OUTPUT |
| 36 | + else |
| 37 | + echo "Changes detected" |
| 38 | + echo "has_changes=true" >> $GITHUB_OUTPUT |
| 39 | + fi |
| 40 | +
|
| 41 | + - name: 'Create: pull request' |
| 42 | + if: steps.check-changes.outputs.has_changes == 'true' |
| 43 | + uses: peter-evans/create-pull-request@v7 |
| 44 | + with: |
| 45 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + commit-message: 'Prefetch-sponsors: update sponsor data' |
| 47 | + title: 'Prefetch-sponsors: update sponsor data' |
| 48 | + body: | |
| 49 | + This PR was automatically created to update sponsor data. |
| 50 | +
|
| 51 | + Changes include updates to sponsor files based on the latest data from OpenCollective. |
| 52 | + branch: prefetch-sponsors/update-sponsor-data |
| 53 | + delete-branch: true |
0 commit comments